Forum
05:10
27/02/2009
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
Moderators
30/10/2007
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
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.
03:07
27/02/2009
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
Moderators
30/10/2007
Hello,
Which version do you use?
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.
10:18
Moderators
30/10/2007
Hello,
In order to understand what is going, could you please put the full configuration of the grid?
Thanks
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.
10:30
Moderators
30/10/2007
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
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.
Most Users Ever Online: 715
Currently Online:
32 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.comModerators: tony: 7721, Rumen[Trirand]: 81
Administrators: admin: 66