jQWidgets Forums
jQuery UI Widgets › Forums › Grid › Custom Sorting 3.6-3.9.1
Tagged: 3.9.1, angular grid, custom sorting, grid, jquery grid, jqxgrid, sort, sorting
This topic contains 11 replies, has 3 voices, and was last updated by trinty 9 years, 5 months ago.
-
AuthorCustom Sorting 3.6-3.9.1 Posts
-
Hello,
Recently updated from 3.6 to 3.9.1. One of our grids that use custom sorting stopped working.
Any idea why? I couldn’t find anything about it in the changes log.
Regards
TrintyI should add some more information about the problem. The grid works fine until one tries to sort one of the columns, no error message is recieved and the grid gets emptied. From just looking at it for a couple of minutes, could it be source.localdata that has been changed?
Regards
TrintyHello Trinty,
Could you, please, share a jsEditor/JSFiddle example reproducing the issue you experience? We would like to test your code in order to determine what causes the described behaviour.
Best Regards,
DimitarjQWidgets team
http://www.jqwidgets.com/That could take some time as I currently have other matters that needs my attention. I will try to provide you with a fiddle as soon as possible but probably not today.
I looked at the difference of the jqxgrid.sort.js and noticed you have added post rendering, thats where I left of. Maybe that can help you in the meantime. I am aware that the problem might lie in my implementation but I find it unlikely as the update from 3.6 to 3.9.1 broke it, and I’ve reverted it back and so on to confirm that it’s the update that breaks it. That’s the only information I can offer you at the time.
I’ll check back tomorrow and provide you with a fiddle if it hasn’t been fixed by then.
Regards
TrintySo this is what I currently have: http://jsfiddle.net/gnwhdzun/34/
However our setup is different as we use: var gridSource =
{
datatype: “json”,
sort: customsortfunc,
datafields: [
{ name: ‘Name’ },
{
name: ‘Data’,
type: ‘array’
},
{ name: ‘dummyColumn’ },
{ name: ‘NavMenuNames’ },
{ name: ‘NavMenuGroups’ },
//four dummycolumns for sorting
{ name: ‘d1’ },
{ name: ‘d2’ },
{ name: ‘d3’ },
{ name: ‘d4’ }
],
cache: false,
url: ‘/Permission/GetData’
};to get our data from server. I’m not sure how to set that up in jsfiddle, maybe you can help me simulate that, the data that is retrieved can always be the same.
From my tests, setting the variable localdata instead of getting the data from a url seems to be working, it seems that the first time when the grid is loaded the data gets retrieved and then loaded into the grid, but after sorting the call is made, the data is retrieved but it does not seem to get loaded into the grid. This was working fine in 3.6, any idea why the destination for the data gets lost?
Issue is: $(“#jqxgrid”).jqxGrid(‘databind’, source, ‘sort’); – incorrect syntax
It is correct to call updatebounddata: http://jsfiddle.net/f3r5cdde/Regards,
Peter StoevWow that was it O.o
Thank you 🙂
Actually the problem remains, just like before the data doesn’t seem to know it’s destination.
If your data is not local, then you will have to take sorting into account on your server i.e return sorted data depending on the HTTP variables which jqxGrid sends.
Regards,
Peter StoevWhat’s weird is that it workes with 3.6
The behavior is this, if I use $(“#jqxGrid”).jqxGrid(‘databind’, source, ‘sort’); in 3.9.1 the grid turns up empty, if I do it in 3.6 the grid gets loaded correcly and gets sorted.
If i switch to $(“#jqxGrid”).jqxGrid(‘updatebounddata’, ‘sort’); in 3.9.1 the grid does no longer turn up empty but the data doesn’t get sorted anymore.
Hi trinty,
databind never had such params. If it worked in 3.6, then it’s by mistake i.e you used Internal params which have changed in newer versions. Never use internal API and use only public Documented API.
Regards,
Peter StoevI understand, sorting should be done on server side before returning the data.
Thank you Peter
-
AuthorPosts
You must be logged in to reply to this topic.