How to change a row's particular cell value in jqgrid

Yasser Shaikh picture Yasser Shaikh · Oct 1, 2012 · Viewed 60.2k times · Source

I want to change a particular rows's cell value, I have the row Id. and I have tried using the following. But it doesnt work.

$("#my-jqgrid-table").jqGrid('setCell',rowId,'Currency', '12321');

I am using loadonce: true

Please can someone help me with this. Thanks

Answer

tpeczek picture tpeczek · Oct 1, 2012

You can use getRowData and setRowData methods to achieve this (they are working directly with data array):

var rowData = $('#my-jqgrid-table').jqGrid('getRowData', rowId);
rowData.Currency = '12321';
$('#my-jqgrid-table').jqGrid('setRowData', rowId, rowData);