Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
70
igGrid load calling remote URL twice
posted

Hi Team,

I am loading data on igGrid from a remote URL. I have used "urlParamsEncoded" property of ig DataSource because I need to send "top" and "skip" values to the remote URL. The issue is that whenever igGrid is loading (initial loading on page load or subsequent data binding on click of button, "urlParamsEncoded" method is called twice, once with the value of "top" and "skip", and once more without those values under "pagingParams".

This behavior is causing my remote URL to be invoked twice. Both these threads calling my remote URL seems to be asynchronous. So sometimes, the later thread has got null "top" and "skip" values, and sometimes, the later thread has got valid values for them. Hence, the data that is eventually bound to the grid is not consistent due to variation in "top" and "skip" values being supplied.

Please find below the link to the JSFiddle reproducing this issue. Here, whether it is first time grid load, or on the subsequent button click, the alert box comes twice - once with "top" and "skip" values, and once without them under paging params.

https://jsfiddle.net/hx82Lanf/

Please let me know how to fix this issue, so that only one call is made to the remote URL, and that too that single call should have values for "top" and "skip", not without those values.