Modify jqGrid cell content _ change cell value _ setCell

Source: Internet
Author: User
Tags setcell jqgrid
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 )!

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.