Focus on new row in Grid

Hi Guys,

I have a grid which has a context menu to allow the user to add a new row, this calls the following code

userGrid.addRow(28000, [1,"", “”, “”, 0, “Never”, “Invalid CrewID Invalid UserName Invalid Password”]);
userGrid.selectCell(28000, 1);

The dataprocessor update is ‘cell’ so the row is immediately sent to the server which sends back the new row id. This seems to effect the selectCell call, I want the focus to be on the newly added row so that the user can then tab through each cell, but in the case above the focus actually jumps to the row above - i presume because the rowid of 28000 is no longer valid? I also tried to wrap the selectCell call in a setTimeout() but that didn’t work either…

Any ideas?!

thanks

This seems to effect the selectCell call
Quite strange, data saving is async, so response must not affect any commands which are added exactly after row adding.

Change your command as

userGrid.selectCell(userGrid.getRowIndex(28000), 1);

Yes that worked perfectly! Thanks Stanislav…