如何根据extjs中列的其他值禁用特定的网格列

时间:2015-11-09 10:37:26

标签: extjs

这是我编码的方式,请帮我禁用特定列:

listeners: {
    beforeedit: function(obj) {
        debugger;
        var c = obj.record.get('quarterlyreview1');
         if(c==="Approved") {
             var d = obj.record.get('quarterlyprogress1');
             obj.record.cancelEdit();
         }
         // return obj.record.get('status');  
         // you can update the above logic to something else
         // based on your criteria send false to stop editing
    }   
},

1 个答案:

答案 0 :(得分:0)

根据the Documentation,如果beforeedit返回false,则停止编辑 (此代码适用于V4和V5)

listeners: {
    beforeedit: function(editor, context, eOpts) {
        debugger;
        var c = context.record.get('quarterlyreview1');
        if(c==="Approved" && (context.colIdx==0 || context.colIdx==1)) {
           return false;
        }
        // return context.record.get('status');  
        // you can update the above logic to something else
        // based on your criteria send false to stop editing
    }   
},