add row + start editor


How can I add a row and start editor to edit the new added cell?

I tried the following code sample, but it is not working to start the editor?

var newDate = new Date();
var gridId = newDate.valueOf()
itemGrid.addRow(gridId, "");
itemGrid.selectRowById(gridId, false, true, false);
var rIndex = itemGrid.getRowIndex(gridId);
itemGrid.selectCell(rIndex, 1);

Did I forget something ?

thanks in advance

Problem can occur if you are calling such code from outside of grid ( from onclick of some button ) , because grid will close editor as reaction on outside click.

You can try to change your code as

itemGrid.selectCell(rIndex, 1);