Jquery Grid中的editable true无法正常工作

时间:2016-08-13 11:22:13

标签: javascript jquery

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

可编辑: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
    });
});

1 个答案:

答案 0 :(得分:1)

你犯了一个小错误...... 在您的代码中,编辑为true而不是false

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