Search code examples
extjsdatagridcheckboxextjs4

Extjs checkcolumn disable for some rows, based on value


I have a grid, with checkcolumn. It's dataIndex is, for example, 'checked'.

I want to disable or hide checkboxes for some rows, where another value, 'can_be_checked' for example, is false/empty.

Renderer is already defined in checkcolumn, messing with it breaks generation of checkbox.

How can I do it?


Solution

  • You may hide the checkbox just inside the renderer, for example:

    column.renderer = function(val, m, rec) {
        if (rec.get('can_be_checked') == 'FALSE'))
            return '';
        else
            return (new Ext.ux.CheckColumn()).renderer(val);
    };