add or insert a row beneath a selected row


I need an example how to add a row under a row that is currently selected. For example I have initially 10 rows where cell data are populated from loadXML, row 2 is currently selected, then user trigger add row - a new blank row should be on row 3 and user will fill in data - the rest of the row shifts down.

Thanks in advance!

Please, try to use the following code:

var rowIndex=mygrid.getRowIndex(mygrid.getSelectedRowId()); mygrid.addRow(newId,["text1","text2"],rowIndex+1);

Thanks for the response but I need another help that is related to the above :wink: With this grid some columns are frozen using mygrid.setColTypes(“ro,ro,ro,ro,ed,ed”) but the requirement calls that on the addRow, the row being added, should have all cells editable. How can I accomplish it? TIA.

Please, try to set the individual exCell type for each column in the row using setCellExcellType() method: … excelltype