I have rows from a table in jqGrid. I manipulate the behaviour of cellEdit
and now use it for editing. After I init the grid, I will use;
$('#grid').editCell(iRow,1,false);
to just select the cell.
but I have only rowId
not iRow
. How can I get iRow
from rowId
?
The index of the row (iRow) you can get using rowIndex property of the DOM object which represent ther row <tr>
. So you need just get the DOM of the row. If the rowId
don't contain any meta-characters you can do just the following
var iRow = $('#' + rowId)[0].rowIndex;
For the more common case you can use jqID function which escapes the meta-characters if needed:
var iRow = $('#' + $.jgrid.jqID(rowId))[0].rowIndex;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With