I have a problem with sorting in a grid using virtualmode in combination with a dataadapter using the loadServerData callback, here is a simplified example:
when scrolling through the grid, the sort function is constantly called. I could work around that to prevent unnecessary update calls, but even that doesn’t prevent that sometimes the grid trips over itself:
Uncaught Error: jqxGrid: The data is still loading. When the data binding is completed, the Grid raises the ‘bindingcomplete’ event. Call this function in the ‘bindingcomplete’ event handler.
The core problem seems to be that the grid tries to keep updating the sorting, even though that’s already handled on the server side. How can I prevent this?
Could you clarify your issue?
I am not sure I understand you very well your case.
This error can be thrown when server-side processing is enabled and you are trying to initiate one operation (sorting/filtering) before another (sorting/filtering) has been completed.
You could try to bind to “bindingcomplete” event with it you will understand when one operation is finished.
Please, take a look at this demo, too:
The problem is the sort is not initiated by my code, this is the call trace for the source.sort() function:
sort @ (index):37
sortby @ jqx-all.js:109
dataview.update @ jqx-all.js:93
q @ jqx-all.js:93
l @ jqx-all.js:93
callDownloadComplete @ jqx-all.js:19
K @ jqx-all.js:19
(anonymous) @ (index):54
I’m simply calling the callback here I got from loadServerData(). The error case is identical, except that it doesn’t make it into my source.sort() function.
My question is: why is that callback attempting to sort anything? It just got the sorted data back from the server.
It is not necessary to use the “loadServerData” callback.
If you bind the data in the right way and using server sorting it should happen on the server side as in this example.
loadServerDatacallback function which allows you to manually handle the ajax calls through the jqxDataAdapter.
I’m updating the grid via a websocket, so using loadServerData is the only option I know of.
Another key aspect is the use of virtual mode, so with huge tables only the visible part is loaded as needed. Your example loads all the data at once, so it’s not applicable to my problem.
When scrolling through a virtual and sorted grid and when it tries to load additional data, only then the problem is triggered. For some reason the grid tries again to sort the received data and sometimes produces that exception.
There is another callback that is possible to use downloadComplete
With virtual mode the data is loaded on demand.
Please, take a look at these demos:
– PHP: “Grid Server Paging”
– Java: “Grid Server Sorting, Paging and Filtering”
Why can’t I use loadServerData? It’s a documented API, which in this situation doesn’t seem to work properly.
Can you please look at the example I posted initially?
You only need to open the console, scroll through the list and you’ll see at least the sort prints, which shouldn’t happen and sometimes it throws an exception.
Unless I’m doing something wrong, this looks to be a bug in jqxGrid.
Still the same exception in 2020 🙁
at c.<computed>.sortby (jqx-all.js:99)
at b.jqx.dataview.dataview.update (jqx-all.js:83)
Could you clarify your issue?
Please, provide a source code that demonstrates this.
Meanwhile, I would like to suggest you try to use all the needed “*.js” files instead of the “jqx-all.js” file.
This will be one fast test to recognize what causes the issue.
You must be logged in to reply to this topic.