Forum


01:16

26/07/2010

Hello,
I'm quite new to jqGrid, and I'm trying to use the "local sorting and server side paging" feature as described in the wiki (http://www.trirand.com/jqgridw.....ide_paging).
However the example code does not seem to work properly with the latest 3.7.2 version.
In my case, the paging is ok but the sorting produces no results at all.
I'm using JSON data, and the callbacks loadComplete and onPaging are called in time. But I think that setting data to "local type" does not seem to work.Or at least the sort does not seem to take it into account.
When using default settings ( remote data), the http server recieves the requests and sorting parameters when sorting is triggered.
I don't know if this is a known bug for this version or am I the first to run into this issue.
Also, I'm quite new to jqGrid, I don"t know where to start in order to trace/investigate the issue in the code.
So any info or pointers would realy help ,
Regards,
Cdrx
18:18

27/07/2010

FYI, I was able to get this working by setting {loadonce: true} when I initialize the grid. Seems like that should just duplicate the functionality of the loadComplete: function(){} mentioned in this tutorial: /jqgridwiki/doku.php?id=wiki:howto_grid_base#client_side_sorting_but_server_side_paging
But for some reason adding the loadonce:true did the trick for me. Go persistence!
Fantastic toolset by the way. Awesome work!
just for clarity
jQuery("#gridID").jqGrid({
loadonce:true,
onPaging: function(which_button){
$j("#gridID").setGridParam({datatype:'json'}).trigger("reloadGrid");
},
loadComplete: function(){
$j("#gridID").setGridParam({datatype:'local'}).trigger("reloadGrid");
}
});
That seems to do the trick. I think loadonce and loadComplete are redundant in their functionality so maybe there's a bug in there or I'm just unclear on when loadonce is supposed to be implemented.
Most Users Ever Online: 715
Currently Online:
69 Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
OlegK: 1255
markw65: 179
kobruleht: 144
phicarre: 132
YamilBracho: 124
Renso: 118
Member Stats:
Guest Posters: 447
Members: 11373
Moderators: 2
Admins: 1
Forum Stats:
Groups: 1
Forums: 8
Topics: 10592
Posts: 31289
Newest Members:
, razia, Prankie, psky, praveen neelam, greg.valainis@pa-tech.comModerators: tony: 7721, Rumen[Trirand]: 81
Administrators: admin: 66