0
votes

I have a checkcolumn as the last column in the grid, i want to disable the row once the checkbox is checked.

onCheckcolumnCheckChange: function(checkcolumn,rowIndex,checked){
//disable row code here
}

disable means, user should not be able to edit the cells of that particular row.

any help is appreciated.

Thanks

2

2 Answers

1
votes

Just switching to RowEditing does not solve your problem. What you need to do, regardless the kind of editing, Row or Cell, you have to listen to the beforeedit event and in the listener you need to check if the record is enabled or disabled. If it's disabled then you return false from the listener:

Pseudo code:

beforeedit:function(editor, context) {
    var disabled = context.record.get('disabled');
    return !disabled;
} 
-1
votes

try using rowEditing for that

var rowEditing = Ext.create('Ext.grid.plugin.RowEditing', {
    clicksToEdit: 2,
    clicksToMoveEditor: 1,
    listeners: {
        'validateedit': function(editor, e) {},
        'afteredit': function(editor, e) {
            email_field.setReadOnly(true);}
    }
});

Check this demo.