How to get a cell value in JQGrid?

dev picture dev · Apr 4, 2010 · Viewed 68.2k times · Source

How to get a cell value in JQGrid?

If I use the following syntax –

var ret = jQuery("#MyGrid").jqGrid('getRowData', id);
ret = ret.ProductId;

it returns the following HTML.

'input class="editable" name=" ProductId " id="0_ ProductId " style="width: 98%;" type="text"'

I actually need the value of the cell.

Thanks. Dev

Answer

HomeSlice picture HomeSlice · Mar 22, 2011

If you only need the value of a cell that has already been saved, you can get it with this

$('#myTable').jqGrid('getCell',row_id,'column_name');