Forum

November 2nd, 2014
A A A
Avatar

Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

The forums are currently locked and only available for read only access
sp_Feed Topic RSS sp_TopicIcon
Sort the data locally each time its obtained from server
17/03/2009
12:18
Avatar
rtordable
Member
Members
Forum Posts: 15
Member Since:
24/02/2009
sp_UserOfflineSmall Offline

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

19/03/2009
05:13
Avatar
tony
Sofia, Bulgaria
Moderator
Members

Moderators
Forum Posts: 7721
Member Since:
30/10/2007
sp_UserOfflineSmall Offline

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.

24/03/2009
05:25
Avatar
rtordable
Member
Members
Forum Posts: 15
Member Since:
24/02/2009
sp_UserOfflineSmall Offline

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

25/03/2009
11:18
Avatar
tony
Sofia, Bulgaria
Moderator
Members

Moderators
Forum Posts: 7721
Member Since:
30/10/2007
sp_UserOfflineSmall Offline

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.

26/03/2009
06:06
Avatar
rtordable
Member
Members
Forum Posts: 15
Member Since:
24/02/2009
sp_UserOfflineSmall Offline

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

Forum Timezone: Europe/Sofia

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.com

Moderators: tony: 7721, Rumen[Trirand]: 81

Administrators: admin: 66

Comments are closed.
Privacy Policy   Terms and Conditions   Contact Information