When using a jqgrid data table, you sometimes need to directly modify the cell content on the interface. When editing a cell using a jqgrid data table, you sometimes need to directly modify the cell content on the interface and edit the cell content.
The following describes how to modify a cell.
JQuery ("# user-list"). setCell (3, 'name', 'cht ');
Another method
JQuery ("# user-list"). jqGrid ('setcell ', 3, 'name', 'ddd ');
SetCell parameter description:
Rowid, row number
Colname, name attribute in colNames
Data, the value to be modified
Class, add a style
If setCell is unavailable (ineffective), pay attention to it.
Id. Use rowid in gqgrid.
If the cell uses formatter to format the data, note that the data value in setCell also needs to match. For example
ColModel: [{label: 'name', name: 'name', index: 'name', formatter: function (cellValue) {if (cellValue = 1) {return "Yes"} else {return "No";} return '';}}]
To make the cell display Yes, the data in setCell needs to be written as 1 as follows:
JQuery ("# user-list"). setCell (3, 'name', '1 ');
The above is the content of the jqGrid cell content modification _ changing the cell value _ setCell. For more information, see PHP Chinese Network (www.php1.cn )!