ExtJS 4 RowEditing disable edit on one column based on record

前端 未结 3 1946
夕颜
夕颜 2021-02-01 18:55

I\'m implementing a grid panel with the four last columns editable for most of the rows. The problem is that I\'d like to be able to disable editing on, let\'s say the first one

3条回答
  •  太阳男子
    2021-02-01 19:21

    (based on the previous example) an alternate way is to configure the editor's beforeedit listener:

    listeners: {
        beforeedit: function(editor, context) {
            var form   = editor.getEditor().form;
            var field  = form.findField('column_name');
            var status = parseInt(context.record.data.status);
            if(status === 4){field.disable();} else {field.enable();}
        }
    }
    

提交回复
热议问题