API not get called for already visited pages in dev express datagrid server side pagination - devexpress

I've created server-side pagination using dev express Datagrid, I'm fetching data properly but I saw that API not getting called if I visit that page again,
Suppose, I visited page 1, page 2 then it fetches data properly, again if I click on page 1 then data displayed in the table is proper but API not getting called.
is it like, it stores all the fetched data or I'm doing wrong somewhere?

[cacheEnabled]="false"
above attribute disables the cache on the dx data grid and calls API in serverside pagination every time you change the page.

Related

How to get the current page of Vmware clarity wizard?

We are using VMware clarity wizard to render wizard pages dynamically and we need to have custom logic to access the current page id/step id of the wizard for validation and other functionalities.
When trying to access page of the wizard, using pagesCollectionService and navService, we are getting the id's correctly for the first time e.g clr-wizard-page-0, clr-wizard-page-1 etc.
But the Problem is on click of cancel/submit from the wizard, the wizard id's are not getting reset, that is when we again open the same wizard the wizard page id's are in continuation to the previous id's
e.g :clr-wizard-page-4, clr-wizard-page-5 etc.
Is there a way by which we can access the page of the wizard by using any other property.
Note: Wizard pages are dynamically rendered using json
Attaching image : page id's that come up when we open the wizard for second time
enter image description here
Adding more information,
Please find the stackblitz link for more details:
https://clarity-light-theme-v013-phyhyk.stackblitz.io
Here we are rendering wizard pages, driven by config
For every wizard page we are displaying angular dynamic forms, where config contains all the information for the form fields .
Since is being called inside a for loop, we need to have a function where on click of next/back or on click of step of the wizard we should be able to validate the current form fields and store the current form fields value.
I have added (clrWizardCurrentPageChanged)="resetFormValidity()" and on every page change i am trying to retrieve the page id using wizard.currentPage.id, but the id's are not getting reset and when i access the multiple times, i am getting incremental id's : clr-wizard-page-4, clr-wizard-page-5 etc.
We are using the below versions :
"#clr/angular": "0.11.30",
"#clr/icons": "0.11.30",
"#clr/ui": "0.11.30",
Is there any other way where i can determine which page it is currently, so that i can compare that with config and continue with validation and form submission.
The Wizard has a property called currentPage which will tell you the current page. The public methods of the Wizard are at https://v2.clarity.design/wizards under the Wizard Deep Dive section, which might replace the need to inject and use the internal services which aren't meant to be used directly in applications (from what I understood in your message, an isolated demo would help greatly).
#ViewChild() wizard: ClrWizard;
get currentPage() {
return this.wizard.currentPage;
}

Pass data between Meteor pages

I have a Meteor application which is a POS system. Once a transaction has been completed a receipt is populated on screen, giving the user the option to print. As the receipt is an entire page in itself (for formatting to correct width etc) it is displayed in an iframe, so a different page to the page displayed for the Till.
Currently the receipt page is subscribing (using SubsManager) to the same collections as the Till page and extracting the data required to form the receipt however this feels very wrong. What I want to do is to simply create a JSON object in the till page containing all data required for the receipt, and just pass it to the receipt page. I'm struggling with how to actually do this though - my setup is using FlowRouter / Blaze. Thinking in a traditional server/client heretic approach I would simply have POSTed this data to the page but it doesn;t seem to be possible here. Is there a standard way to achieve this?

knockout in asp.net web from master page

Good day.
I was using knockout in an asp.net web form master page. On master page i have an advanced search control completely with knockout. After selecting the search criteria by readio buttons, tabs and dropdowns, on clicking a search button redirect to a details page which is also inherited from the same master page.
I need to persists the selected view from the first page in the details page along with populating the search result.
But I'm unable to do it as an infant in knockout.
I guess if I can remove the binding and apply it again, it will be happen.(don't know I'm wrong or not).
Kindly advice me to get over this situation.
Thanks
Santhi
It sounds like you're doing a complete trip to the server between pages. In that case you'll need to store the state of your search box somehow before the redirect, and then load that state after the redirect. You have a couple ways to do this.
Using Cookies
You could serialize the state of your select control into a JSON string and store it in a cookie. When your search box loads, look for that cookie using JavaScript and if it exists, load the data into your search box.
Using the Query String
You could serialize the state of your select control into the query string, and load from that. This would be a little bit more reliable in case cookies are turned off on the user's browser.
Using Local Storage
If you're working in modern browsers and supporting HTML 5, you could use HTML 5 local storage to store the search state between postbacks. http://diveintohtml5.info/storage.html
Serializing your Model State
Take a look at this page of the Knockout JS documentation for more info on serializing your object graph. http://knockoutjs.com/documentation/json-data.html
I hope this helps!

getting partial response for one single call

I am using dotnet 3.5 and AJAX and i want to get partial responses for my one single call given to server.
Its like I want to retrieve multiple profiles in one call and cannot let the system wait for all the profiles to get loaded.
Meanwhile all the profiles are loading in form of strips on the screen the user should be able to start working with the already loaded profiles.
eg
If I gave call to server and it returns 10 profiles in result then while displaying it one the screen I do not want the user to wait for all 10 profiles get loaded instead, he should be able to start working as soon as 1st profile loads and meanwhile rest 0 profiles loads on the screen.
Is it possible using Javascript, AJAX. IF yes, then how? Kindly help.
Thanks in Advance ^_^
Devshree
This is certainly possible using AJAX.
The way the page would load would be as so:
Page loads instantly with profile display area
Ajax call requests profiles
The server uses multiple HttpResonse.Write() to return profiles which gets rendered on the broswer (as they're received by the browser)
The rendering element could be acheived through an update panel or even some jQuery for more fine-tined control.

Adding controls dynamically to the page from asp.net web method

I am using jquery ajax method to get data from a web method and present data using DOM(similar to that of google search results).B'coz the data returned from the web method is huge I want to paginate the results.For that I need to create buttons corresponding to the page numbers based on the no. of records the web method retrieves from the database.So I have taken a div on the page.In the web method ,as soon as I can find the number of records obtained from the database,I want to create the buttons and add to this div and display 10 records per page.As far as I know, it is not possible to access anything that is placed on the asp.net page from Web method.In that case how do I paginate the results?
Please help.
if you are using JQuery ajax, you can recreate the UI on the client by doing statements like:
$("<input/>").attr("type", "button").click(function() { .. }).appendTo("parentElementselector");
$.each(webmethodresults, function(i, item) {
//Create UI here using approach illustrated above
});
And programmatically recreate for each page.
EDIT Or find a third party table control that you can bind to on the client side. MS AJAX 4 has some client-side JS components to do this or there are some JQuery ones... but either way, if using JQuery to stream via AJAX, you have to create on the client.
Here is an alternative suggestion on how to handle this scenario:
When the page loads determine how many records you will be returning.
Divide this by how many records you want to show per page (10).
Add paging controls based on how many pages you will have at 10 records per page.
Only query the database for the 10 records you will be showing on a given page. If the data is extremely huge you will not want to load it all into memory anyways. This can be done with a method signature that accepts how many records per page and the the current page you are on.

Resources