Extjs checkcolumn disable for some rows, based on value

Nameless picture Nameless · Apr 6, 2012 · Viewed 24.9k times · Source

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?

Answer

Aniketos picture Aniketos · Apr 6, 2012

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);
};