Forum

July 10th, 2011
You must be logged in to post Login Register

Search Forums:


 






Disable groupfield sort

UserPost

01:39
19/04/2012


betolj

Brazil

New Member

posts 2

First, i'd like to say that this is a great project – congratulations!

My English is not very good, but I'll try.
So, I'm working on a firewall solution and would like to share the experience with jqgrid. I get the data remotely in json format, but i manage the information only in memory (client side). For this reason I needed to use the "loadonce" and use clientArray in editUrl. And I save everything (with ajax) in the end (save button).

The difficulty was that i get the data sorted by the server. But, to update "grouping" a need a "reloadGrid" after insert, edit, clone or delete operations.  I can not sort by "groupField" but by "id" (rowid).  I tried various settings to disable sorting on the client side.

So I made a change in jqgrid.

—- my jqGrid def

           groupingView : {
              groupField : ['inPol'],
              groupColumnShow : [false],
              groupCollapse : false,
              groupDataSorted : false,
              groupSorted: false,
              groupText : ['<b>{0}</b>  {1}']

           },

—-

The new option is "groupSorted".
I can disable grouping client sort in this way.

The change in jquery.jqGrid.min.js was very simple…

…if(a.p.grouping){if(u.groupSorted===true){r.orderBy(C,u.groupOrder[0],p[0].stype,p[0].srcfmt)};u.groupDataSorted=true}…
…k=d.groupCollapse?d.plusicon:d.minusicon,l,r,m;if(!d.groupDataSorted && d.groupSorted===true){d.sortitems[0].sort();…

I saw that other people have also had the same problem.
How the change is minimal, I would propose this as a patch for future versions. So no need to change manually when upgrading too.

Thanks



About the jQuery Grid Plugin – jqGrid forum

Most Users Ever Online:

157


Currently Online:

85 Guests

Forum Stats:

Groups: 1

Forums: 7

Topics: 9661

Posts: 28948

Membership:

There are 10357 Members

There have been 448 Guests

There is 1 Admin

There are 2 Moderators

Top Posters:

OlegK – 1167

markw65 – 179

kobruleht – 144

phicarre – 126

YamilBracho – 124

Renso – 118

Administrators: admin (56 Posts)

Moderators: tony (7043 Posts), Rumen[Trirand] (81 Posts)




Comments are closed.
Privacy Policy   Terms and Conditions   Contact Information