Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by roxana aioanei on Sep 01, 2008 05:53
open dhtmlx forum
How can I select the last row from the grid

Hello!
I solved my probleme:
mygrid.cells(mygrid.getRowId(i),6).setValue('<a href='<?=BASEURL?&gt;managing_bustrip_busses/?pbt='+busTripID+''&gt;<?=LBL_ALOCATE?&gt;</a&gt;');

Now I have another one:
How can I select the last row from the grid, I tried:
mygrid.loadXML(...);
mygrid.setSelectedRow(mygrid.getRowsNum()-1);
Thanks

Answer posted by Support on Sep 01, 2008 06:08
The loading is async. , you must to catch moment when data will be loaded in grid to call row related methods. 
It can be done by onXLE event or by second parameter of loadXML

mygrid.loadXML(url,function(){
           mygrid.selectRow(mygrid.getRowsNum()-1);
});