0
votes

I have a celledit grid, and it also has celledit grids as subgrid, and they are not sortable.

When I add a new row at the bottom by the method, addRowData, I want to set the focus on the first editable column of the new row by the method, editCell(iRow,iCol,true).

Since my grid has subgrids, the largest iRow will not equal to the largest rowid if any subgrid was expanded.

so, my question is

Is there any way to get the iRow of the new added row? Thank you.

1

1 Answers

0
votes

You can select the last row element with respect of

var $lastRow = $('#grid>tbody>tr.jqgrow:last');

The rows from the subgrid has the class 'ui-subgrid' instead of the rows of the main grid have the class 'jqgrow'. To get the index on the last row iRow you can use rowIndex property of the <tr> element

var iRow = $('#prods>tbody>tr.jqgrow:last')[0].rowIndex;