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_Related Related Topics sp_TopicIcon
Sorting by Column with JSON Data Type In the Javascript Level
14/06/2010
13:55
Avatar
Acromantula
Member
Members
Forum Posts: 4
Member Since:
14/06/2010
sp_UserOfflineSmall Offline

HI

I have have the requirement of sorting the data in a grid that was retrurned from a Request by clicking the column, without sending a request to the action level when the column is clicked (DataType 'json' grid with pagination intact)

Does Jqgrid support this functionality.

Thanks in Advance

20/06/2010
10:52
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

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.

21/06/2010
09:35
Avatar
Acromantula
Member
Members
Forum Posts: 4
Member Since:
14/06/2010
sp_UserOfflineSmall Offline

Hi Tony Thanks for the reply.

Ur solution works in essentials but there are some minor issues. (I'm using jqGrid  3.5 with jquery v1.3.2.)

1. After LoadComplete. "reloadGrid" trigger wont work properly because the datatype is set to 'local'. Workaround is to set the attach an onclick method to '.ui-icon-refresh' to set the dataType to json on each click.

2. After the column is sorted the grid.page parameter is set to 1. Is there a way to stop the the page number being set to 1 when we change the datatype to local?  

(Is "Client side sorting, but server side paging" available only in jqgrid 3.6 only? If so is there a workaround for this issue in 3.5?)

Cheers

25/06/2010
10:45
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

1. In the example we do not use loadComplete, so it depend what you try to do.

2. You are right - in the same loadComplete - obtain a current page and then set it in onPaging event as parameter.

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.

28/06/2010
07:08
Avatar
Acromantula
Member
Members
Forum Posts: 4
Member Since:
14/06/2010
sp_UserOfflineSmall Offline

Thanks for ur help.

decided to retrive to current page on loadComplete and reset it after onSortCol event to the grid.page parameter

Cheers

21/07/2010
12:33
Avatar
Acromantula
Member
Members
Forum Posts: 4
Member Since:
14/06/2010
sp_UserOfflineSmall Offline

For Everyone's information

I have modified the jqgrid source file to achieve the objective.

Modifications

Added a new flag to the jqgrid options.

Modification to the sortData function to only set the current page as 1 if the flag is false.

Modification to the sortData functino to fire the sortArrayData function only if the flag is true and to fire the populate function if the flag is false.

By doing this there's no need to change the datatypes or any other options for each grid.Functionality works for reloadgrid / paging (using serverside processing with data type as 'json')

Hope this can be integrated in the future releases

Cheers.

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

Currently Online:
54 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