JqGrid - how to find iRow (row index) from rowId (table pri key)

I have rows from a table in jqGrid. I control the behavior cellEditand now use it for editing. After mesh initialization I will use;

$('#grid').editCell(iRow,1,false);

to just select a cell.

but I only have rowIdnot iRow. How can I get iRowout rowId?

+5
source share
1 answer

In the row index (iRow), you can use the rowIndex property of the DOM object that represents the row row <tr>. So you just need to get the DOM of the string. If it rowIddoes not contain metacharacters , you can only do the following

var iRow = $('#' + rowId)[0].rowIndex;

jqID, :

var iRow = $('#' + $.jgrid.jqID(rowId))[0].rowIndex;
+6

All Articles