Dynamic data is not loading using pager and custom proxy

Hello,
While navigating through different pages in datatable, after some specific pages data is
not loaded in table. Here is my code. (Please read comments as I have used custom
proxy to load data in table)

http://webix.com/snippet/014a41a3

While ajax goes out to get data for the first time then in response it gets 40 records (because of datafetch config) and shows 10 records on first page.

When I navigate to 4th page it shows 10 records (which was pulled from first ajax request) but due to loadahead config. In callback of ajax I get expected record but it is not showing on 5th page.

I can’t use url config of datatable as I need to modify ajax request before fetching any
data from server. How can I solve this scenario ?OR I’m implementing it in wrong way ?

Thanks

Sanket

Hello,

It looks like the default loading callback is ignored, so datatable doesn’t request for new data any more. You can just pass the callback you get as the third parameter of your GET request.

Try this snippet, please: http://webix.com/snippet/c07633df

Thanks @Helga. Problem was in server response. The parameter ‘pos’ was sending
0 index always. So data was got override on first position. So I set ‘start’ parameter
in server response to get proper index.

However, I have another query about this though pagination is working fine but when I navigate to last page and navigate to previous pages then it never trigger ajax request to get updated data.

My question is, if data is stored in this manner then how it is going to handle 1M+ data? This will create performance issue if it is storing this data locally, is there any workaround for this?

Thanks,

Sanket

not webix but browser caches response data. looks like you are using GET method for request. to prevent caching use POST method or add some random parameter (e.g. Date.now() or webix.uid()) to request query.

Hey @intregal, I tried using uid() or Date.now() to my request but the issue is ‘load’ event of custom proxy is never get called when I navigate to pages which is already loaded.

For ex.- Check this snippet http://webix.com/snippet/66a69c9c Go to page 1,2,3 then navigate to page 2 then 1. It never trigger ajax request.

Any Help ?