1
votes

I have a simple grid of multiple columns and each column editable fields. When I call column.disable() only the header of the column is getting disabled and the fields in the column are still editable. How can I disable all the fields in the column ?

2

2 Answers

1
votes

in combination with the beforeedit event handler, you can use a renderer to alter the tdStyle of the cell to indicate it is disabled:

renderer: function(value, meta, record, rowIdx, colIdx, store, view) {
    var column = this.getHeaderContainer().getHeaderAtIndex(colIdx);
    if (column.disabled) {
        meta.tdStyle = "opacity: 0.4;";
    }

    return value;
}

tdCls is even better and allow more fine tuning of the appearance.

1
votes

You must call disable method after render your editor. I use beforeedit event for disable my fields For example:

beforeedit: function (editor, context) {
    ...
    editor.editor.down('onetomanyeditor').disable()
    ...
},