Hi,
I am having issues with remote pagination. The pages are not getting displayed properly on click of a button outside of the grid.
Suppose I am having 20 records in total, hence count attribute will be 20, while my server serves first 4 records. On the first time load, the grid loads perfectly fine showing those 4 records and showing 5 pages, that would equate to 20 records total.
Now if I click a button, on whose click event the same method for loading the grid is fired, all the 4 records are shown, but the 5 pages shown at bottom disappears. It assumes only one page, even though the backend API continues to provide 20 records in the count attribute.
Please find at below link the issue that is reproduced.
https://jsfiddle.net/q0b2o68x/
Please let me know when can this issue be fixed?
Hello Vaibhav,
Thank you for your patience while I was looking into this matter for you.
This issue is not related to the remote pagination or the external button. The reason for this behavior is because you are reinitializing the grid. What I would suggest you is to initialize the grid only one time and if you need to change its data sorce you can do it through the external button using the dataSource option of igGrid:
function reloadData() { var url = "https://mocki.io/v1/f7970ac8-9f6e-4a87-b260-c2f2ed352e8c"; ds = new $.ig.DataSource({ type: "remoteUrl", dataSource: url, schema: oDataSchema, responseDataKey: "items", responseDataType: "json", responseContentType: "application/json; charset=utf-8" }).dataBind(); $("#grid").igGrid("option", "dataSource", ds) }
Here you can find a small sample demonstrating my suggestion. Please test it on your side and let me know whether you find it helpful.
Looking forward to hearing from you.
Regards,Viktor KombovEntry Level Software DeveloperInfragistics, Inc.
Thank you so much, Viktor. Your suggestion fixed this issue.