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
Expand only first grouping level of grid with multiple groupings
08/10/2014
00:40
Avatar
vestyj
New Member
Members
Forum Posts: 2
Member Since:
08/10/2014
sp_UserOfflineSmall Offline

I have a grid with multiple groupFields.  I set groupCollapse to true so grid displays with all rows collapsed initially.  I would like to expand all first level groupings when the grid loads.  So for example, in my grid with two grouping levels, I end up with row id's like:

  • ghead_0_0
  • ghead_1_1
  • ghead_0_2
  • ghead_1_3
  • ghead_1_4

I want to expand ghead_0_0 and ghead_0_2 in this case (but all the ghead_1_* stay collapsed).  I assume I need to add something to loadComplete, but not sure what to iterate, how to identify what to 'groupingToggle'.  

09/10/2014
17:00
Avatar
vestyj
New Member
Members
Forum Posts: 2
Member Since:
08/10/2014
sp_UserOfflineSmall Offline

Here's what I came up with:

loadComplete: function () { 
  var $this = $(this), groupRows = $this.find('tr.jqgroup'); 
  for (var x = 0; x < groupRows.length; x++) { 
    if (groupRows[x].id.indexOf("ghead_0_") >= 0) { 
      $this.jqGrid('groupingToggle', groupRows[x].id); 
    } 
  } 
}
21/10/2014
17:02
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

Thanks for posting your solution.

Kind Regards

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.

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

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