DhtmlxGrid

I am using the following code to add a new row into the grid on f-12 key. But instead on inserting the new row just above the selected row, a new row is being inserted at the top of the grid. Why is this happening?



mygrid.attachEvent(“onKeyPress”,function(code){

if (code == 123 ){

mygrid.addRow((mygrid.getRowsNum()+1),[’’,’’,’’,’’,’’,’’,’’,’’,’’,’’,’’,’’,’’,’’,’’,’’,’’,’’],mygrid.getRowIndex(mygrid.getSelectedId()));

}

else return true;});

The same code works fine in case of local samples ( please check attached sample )
Most probably issue caused by usage on non-unique IDs in grid ( please be sure that each row in grid has unique ID )

1210241143.zip (89.3 KB)