开发者

How to disable field column in jqgrid?

开发者 https://www.devze.com 2023-03-27 17:05 出处:网络
How to disable field column in jqgrid? this is my code : jQuery(\"#penanggungJawab\").jqGrid({ mtype: \"GET\",

How to disable field column in jqgrid? this is my code :

jQuery("#penanggungJawab").jqGrid({
    mtype: "GET",
    datatype:"json",
    height: 50,
    width:900,
    colNames:['ID Card','Type Id Card','NO Id Card', 'Expired Date'],
    colModel:[ {
        name:'idCardIdPnggungJwb',
        开发者_StackOverflow中文版index:'idCardIdPnggungJwb',
        width:310,
        editable:true,
        hidden:false,
        ***disabled:true***
    }, {
        name:'typeIdCardPnggungJwb',
        index:'typeIdCardPnggungJwb',
        width:310,
        editable:true,
        edittype:"select",
        editoptions:{value:"KTP:KTP;IDC:ID Card Company"},
        jsonmap:'typeIdCard'
    }, {
        name:'nomorIdCardPnggungJwb',
        index:'nomorIdCardPnggungJwb',
        width:310,
        editable:true
    },{
        name:'expiredDatePnggungJwb',
        index:'expiredDatePnggungJwb',
        width:310,
        editable:true,
        editoptions:{size:12, dataInit:function(el) {
            $(el).datepicker({dateFormat:"yy/mm/dd",changeMonth: true,changeYear: true});
        },
    }}],
    rowNum:10,
    rowList:[10,20,30],
    pager: '#Keuangan',
    sortname: 'typeIdCardPenanggungJawabKeuangan',
    viewrecords: true,
    sortorder: "desc",
    caption:"Grid No Kartu Identitas",
    editurl: "noabjad.json"
}); jQuery("#penanggungJawab").jqGrid('navGrid','#Keuangan',{
    del:false,
    search:false,
    edit:false
},{
    reloadAfterSubmit:false
},{
    reloadAfterSubmit:false
});

Can I disable one of the columns, that can not be edited?


If I understand your requirements correct you need use

editoptions: {disabled: true}

option for the 'idCardIdPnggungJwb' column. The results you will see here.

0

精彩评论

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

关注公众号