javascript - Jquery Grid 中的 editable true 不起作用

标签 javascript jquery

我想让 Jq-Grid 可编辑,我试过 editable : true 但它不起作用....

可编辑:真不工作

$(document).ready(function() {

    $("#list2").jqGrid({
        url: '/Home/GetAll/',
        datatype: "json",
        contentType: "application/json; charset-utf-8",
        mtype: 'GET',
        colNames: ['Employee Name', 'Designation',
            'Gender', 'DOB'
        ],
        colModel: [
            { name: 'name', index: 'name', width: 150, editable: true },
            { name: 'DesignationID', index: 'DesignationID', width: 150, editable: true },
            { name: 'Gender', index: 'Gender', width: 100, editable: true, editable: true },
            { name: 'DOB', index: 'DOB', width: 150, editable: true }
        ],
        rowNum: 10,
        rowList: [5, 10, 15],
        pager: '#pager2',
        sortname: 'id',
        height: 200,
        viewrecords: true,
        sortorder: "asc",
        caption: "Employee Records"
    });
    jQuery("#list2").jqGrid('navGrid', '#pager2', {
        edit: false,
        add: false,
        del: false
    });
});

最佳答案

你犯了一个小错误...... 在你的代码中使编辑为真而不是假

   jQuery("#list2").jqGrid('navGrid', '#pager2', {
    edit: true,
    add: false,
    del: false
    });

关于javascript - Jquery Grid 中的 editable true 不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38932172/

相关文章:

javascript - Rubaxa Sortable 如何获取项目数组

javascript - 由于屏幕方向更改而调整大小*后,如何获取元素的新尺寸*?

javascript - 从 ExtJS 5.1 中的方法访问 Singleton 值

javascript - "search"过滤内容的字段

c# - 服务器端分页和排序最佳实践?

javascript - 使用 jquery 的搜索栏

javascript - 从函数中的 id 访问号码

jquery - 有没有办法选择 .data() 附加的值?

javascript - Select2 - 点击触发打开,无需打开库函数

javascript - 修改 HTMLCollection 返回所有 innerHTML