| User | Post |
|
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 |
|
|
|
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
|
|