Forum

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

Search Forums:


 






Adjacency Treegrid doesn't expand

No Tags
UserPost

05:10
11/05/2009


VinZ40K

Member

posts 4

I'm trying to get the Treegrid to automaticly expand the last open node after reloading the data. However I can't seem to get it to work, the expandNode function doesn't open the row.

My code:

$('#grid').expandNode($('#grid').getInd(lastClickedRow));

lastClickedRow is the rowId of the row I want to open. This function does something (the grid reloads), but it doesn't expand the rows. We load all the data at once, so the should be no need to reload the grid (when clicking in the grid on the + it opens fine, without reloading the grid)

What am I doing wrong, any ideas?

14:08
13/05/2009


tony

Sofia, Bulgaria

Moderator

posts 7009

Hello,

Try this

var mygrid = $("#grid");

mygrid.expandNode(mygrid.getInd(mygrid[0].rows, lastClickedRow, true));

To getInd we pass 3 parameters – object , rowid and true/false

in case of true we return the row object in case of false(default) rowIndex.

Regards

Tony


03:07
14/05/2009


VinZ40K

Member

posts 4

I've tried your code, and while the grid doesn't reload it also doesn't expand the rows. The [+] icon does change to a [-], and clicking the [-] does nothing except change it back to the [+].

Clicking the [+] or [-] in the grid itself works perfect. Using the expandNode function just doesn't show the subrows. Any thoughts why?

01:40
15/05/2009


tony

Sofia, Bulgaria

Moderator

posts 7009

Hello,

Which version do you use?

Regards

Tony

04:23
15/05/2009


VinZ40K

Member

posts 4

Version 3.4.3

10:18
20/05/2009


tony

Sofia, Bulgaria

Moderator

posts 7009

Hello,

In order to understand what is going, could you please put the full configuration of the grid?

Thanks

Regards

Tony

10:30
20/05/2009


tony

Sofia, Bulgaria

Moderator

posts 7009

Ok,

I look into the code – You should first apply

expandRow and then expandNode something like this

$("#mybutton").click(function(){

var mygrid = $("#grid");

var record = mygrid.getInd(mygrid[0].rows, lastClickedRow, true);

mygrid.expandRow(record);

mygrid.expandNode(record);

return false;

});


Regards

Tony


No Tags

About the jQuery Grid Plugin – jqGrid forum

Most Users Ever Online:

157


Currently Online:

darkwarrior

45 Guests

Forum Stats:

Groups: 1

Forums: 7

Topics: 9592

Posts: 28785

Membership:

There are 10170 Members

There have been 448 Guests

There is 1 Admin

There are 2 Moderators

Top Posters:

OlegK – 1157

markw65 – 179

kobruleht – 144

phicarre – 126

YamilBracho – 124

Renso – 118

Administrators: admin (56 Posts)

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




Comments are closed.
Privacy Policy   Terms and Conditions   Contact Information