I am using a JQGrid. Based on a condition of a cell value(i.e "Stabilized" in my case) I need to update another cell of the same row. updated value should store in backend db also. I am using cell Formatter to achieve this. But I am not able to call "setRowData" in JQGrid as other parameters not able to extract rowObject parameter in Formatter method. Any suggestion is highly appreciated.
colModel: [
{ name: 'srno', index: 'srno', align: 'center', width: 60, editable: true,key:true},
{ name: 'dev_id', index: 'dev_id', align: 'center', width: 80, editable: true},
{ name: 'cmd', index: 'cmd', align: 'center', width: 280, sortable: false, editable: true },
{ name: 'dstatus', index: 'dstatus', align: 'center', width: 100, sortable: false, editable: false,formatter: deviceFormatter}
]
function deviceFormatter(cellvalue, options, rowObject) {
if( cellvalue == "Stabilized"){
rowObject[2] = "Some Updated Value";
//Save the modified cell value to Grid
// $('#jqg_test').jqGrid('setRowData', rowid, rowData);
}
}