开发者

jqGrid change row values

开发者 https://www.devze.com 2023-02-10 16:02 出处:网络
How can I开发者_如何学C change data already present in my grid\'s row with different data on click of a button?

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);
0

精彩评论

暂无评论...
验证码 换一张
取 消