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 All and Collapse All Functionality in Tree Grid
02/06/2009
11:10
Avatar
mnvinod
Member
Members
Forum Posts: 16
Member Since:
02/06/2009
sp_UserOfflineSmall Offline

Could you please provide me the sample code to expand all the nodes/ collapse all the nodes in the tree grid at once by clicking on the custom button on the navigation bar?

Thanks in advance.

04/06/2009
03:52
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

HEllo,

Try this (Not tested)

$(".treeclick","#mygrid").each(function() {

if($(this).hasClass("tree-plus") $(this).trigger("click");

});

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.

09/06/2009
00:17
Avatar
mnvinod
Member
Members
Forum Posts: 16
Member Since:
02/06/2009
sp_UserOfflineSmall Offline

Thanks a lot Tony. Its working.

I do have one more query. I am using the following code to refresh the tree grid.

jQuery("#grid_id").trigger("reloadGrid"); 

But, it is taking considerable amount of time to refresh the tree grid. Is there any other way to refresh the tree grid which minimizes the time taken to refresh.

09/06/2009
05:17
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello

If you return only the root nodes you will have to spare a couple of time. Using tree grid in relative big nodes from server slow down the grid because we needed a couple of client side processing to construct the tree.

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/09/2009
12:38
Avatar
fuhrysteve
Member
Members
Forum Posts: 12
Member Since:
24/09/2009
sp_UserOfflineSmall Offline

Firing the click event on tree-plus is expanding rows, but it is appending them all to the bottom of the table instead of beneath their parents.

Has anyone found a workaround to achieve a reliable “Expand All” feature?

Btw, here's what I use for Collapse All — works great:

$(".treeclick","table#mygrid").each(function() {

if($(this).hasClass("tree-minus")) {

$(this).trigger("click");

}

});
29/09/2009
11:19
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

Which version of jqGrid do you use?

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.

29/09/2009
11:31
Avatar
fuhrysteve
Member
Members
Forum Posts: 12
Member Since:
24/09/2009
sp_UserOfflineSmall Offline

Hey Tony,

The latest version of course! 3.5.3

02/10/2009
10:27
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

I will prepare such methods for 3.6 release

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.

02/09/2010
12:00
Avatar
adamovic
Member
Members
Forum Posts: 4
Member Since:
31/08/2010
sp_UserOfflineSmall Offline

Hey tony,

could you make an (optional) expand all / callapse all buton in the header of jqgrid's containing subgrids? That feature seems to be convenient for some.

tony said:

HEllo,

Try this (Not tested)

$(".treeclick","#mygrid").each(function() {

if($(this).hasClass("tree-plus") $(this).trigger("click");

});

Regards

Tony


23/03/2011
13:20
Avatar
jmav
Member
Members
Forum Posts: 34
Member Since:
16/10/2009
sp_UserOfflineSmall Offline

Tony did you makeit to do the method expand all?

12/08/2011
00:37
Avatar
Maverick
New Member
Members
Forum Posts: 1
Member Since:
11/08/2011
sp_UserOfflineSmall Offline

I simply created a new pager button:

jQuery("#mygrid").jqGrid('navGrid', "#pager").jqGrid('navButtonAdd', "#pager",{
    caption: "Expand/Collapse All",
    buttonicon: "ui-icon-triangle-2-n-s",
    onClickButton: function() {
        $("#mygrid").find(".treeclick").trigger('click');
    },
    position: "last",
    title: "Expand/Collapse All",
    cursor: "pointer"
});
Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

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