jqGrid change row values
How can I开发者_如何学C change data already present in my grid's row with different data on click of a button? I want to update the values of selected row with new values.
The code could look like
var myGrid = $("#list");
var selRowId = myGrid.jqGrid('getGridParam','selrow');
myGrid.jqGrid('setRowData',selRowId,newData);
where the newData
in the object of data that contain the new values. The structure of array is in type name:value (for example {firstName:"foo", lastName:"bar"}). You can examine the current data from the row with
var oldData = myGrid.jqGrid('getRowData',selRowId);
精彩评论