Row Selection

The following method you posted worked for selecting. However, mygrid.attachEvent(“onRowSelect”,doOnRowSelected); does not fire when using the code. Is there a way to manually make it work?





There are no special commands for such task , but it can be done as



var current = grid.getSelectedId();

if (!current) return;



//select next

grid.selectRow(grid.getRowIndex(current)+1);



//select previous

grid.selectRow(grid.getRowIndex(current)-1);



By default - onRowSelect event initiated only when selection changed, it not occurs for API calls.
You can call any event manually, by using grid.callEvent(…, but in case of row selection there is a more simple way - just set second parameter of command as true

//select next

grid.selectRow(grid.getRowIndex(current)+1,true);



With second parameter set as true, selectRow command will fire onRowSelect event