jqGrid更新字段“editable:false”

时间:2012-07-18 16:32:39

标签: jquery jqgrid

我正在使用 jqGrid ,我已经编辑了一行然后保存了它,所有数据都发送到更新网址。
但我有一个问题,如果“ 可编辑:false ”,则在“firmasID”字段中 我收到一个空的 firmasID 值。

 $("#companies").jqGrid({
         url:'/load/rateseditor_companies/controller/load/',
            datatype: "json",
            colNames:['ID','FinSysID', 'Company', 'Code','Code sparcs','Jur address','Address2','Phone','Fax','Email','Contract Date','Bank accaunt','Bank id','Price list','KonsignTab','Remarks','BankID USD','Bank accaunt 1','BCT bank','Resident','Days to pay'],
            colModel:[
                {name:'firmasID',index:'firmasID', width:55},
                {name:'FinSysID',index:'invdate', width:90, editable:true},
                {name:'firmasNosauk',index:'Company', width:100,editable:true},
                {name:'firmasKods',index:'Code', width:80, align:"right",editable:true},
                {name:'firmasSPARCS',index:'Code sparcs', width:80, align:"right",editable:true},       
                {name:'jurAdrese',index:'Jur address', width:80,align:"right",editable:true},       
                {name:'nosAdrese',index:'Address2', width:150, sortable:false,editable:true},
                {name:'Telefons',index:'Phone', width:150, sortable:false,editable:true},
                {name:'FAX',index:'Fax', width:150, sortable:false,editable:true},
                {name:'Email',index:'Email', width:150, sortable:false,editable:true},
                {name:'piegLigumDat',index:'piegLigumDat', width:150, sortable:false,editable:true},
                {name:'bankasReķins',index:'bankasReķins', width:150, sortable:false,editable:true},
                {name:'bankasID',index:'bankasID', width:150, sortable:false,editable:true,edittype:"select",editoptions:{value:getBanks()}},
                {name:'cenLapa',index:'cenLapa', width:150, sortable:false,editable:true},
                {name:'konsignTab',index:'konsignTab', width:150, sortable:false,editable:true},
                {name:'piezimes',index:'piezimes', width:150, sortable:false,editable:true},
                {name:'bankasIDUSD',index:'bankasIDUSD', width:150, sortable:false,editable:true},
                {name:'bankasRekins1',index:'bankasRekins1', width:150, sortable:false,editable:true},
                {name:'BCTBanka',index:'BCTBanka', width:150, sortable:false,editable:true},
                {name:'Rezidents',index:'Rezidents', width:150, sortable:false,editable:true},
                {name:'Days_to_pay',index:'Days_to_pay', width:150, sortable:false,editable:true}
            ],
            rowNum:22, 
            rowList:[10,20,30],
            pager: '#pager2',
            width: '100px', height: "500px",
            sortname: 'firmasID',
            viewrecords: true,
            sortorder: "desc",
            editurl: '/load/rateseditor_companies/controller/update/',
            caption: "Companies list"
        });

1 个答案:

答案 0 :(得分:3)

使用

editable: true, editoptions: { readonly: 'readonly' }

代替