Forum


12:18

24/02/2009

Hello,
My table obtains and refresh the JSON data from the server - datatype: 'json' - but it can't be sorted on it. I'd like that jqGrid before populating the server data on the table could sort it using the colModel criterias, the same way when the datatype is local. Is that possible?.
Thanks in advance.
Ramón
05:13

Moderators
30/10/2007

Hello,
Use loadonce:true - see docs
Regards
Tony
For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.
05:25

24/02/2009

Hello Tony,
If I use loadonce:true de data only is obtained from the server once.
I wanted that each time the user 'refresh' the table through the navigation bar or 'sorts' de data clicking a column header, jqGrid gets the server data through AJAX and sort it in client side BEFORE populating the rows on the table. Is that possible?
Thanks and regards.
Ramón
11:18

Moderators
30/10/2007

Hello,
Try to use gridComplete method where you can call sortData method - it is exactly what you want - do not use loadonce.
Regards
Tony
For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.
06:06

24/02/2009

Hello Tony,
Finally the solution was the following code in the gridComplete or loadComplete method:
$("#jqGridTable").setGridParam({datatype:"local"})
.trigger("reloadGrid")
.setGridParam({datatype:"json"});
That was not exactly the solution I was looking because the jqGrid table fills two times the data on the table, the first one when gets de data from the server -addJSONData- and the second one when it is sorted locally.
I thought that jqGrid could sort the JSON data object before it is filled on the table, maybe in future versions.
Nevertheless, Tony your plugin it's great ... congratulations !!!.
Thanks and regards.
Ramón
Most Users Ever Online: 715
Currently Online:
49 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