繁体   English   中英

如何基于extjs中列的其他值禁用网格的特定列

[英]how to disable particular column of grid based on other value of column in 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
    }   
},

根据文档,如果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
    }   
},

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM