EXTJS 禁用复选框中的复选框

Adi*_*rti 4 checkbox grid extjs extjs4.1

我想根据其他列的值禁用行的特定复选框。

我在这里查看了问题。但是这里的所有答案只是修改了 css 。

我不想要更新的 css 。我想实际上禁用单击复选框。

有什么办法可以实现这一点吗?

Aja*_*kur 6

你可以这样做也
检查小提琴:
https ://fiddle.sencha.com/#view/editor&fiddle/1maa

    var userStore = Ext.create('Ext.data.Store', {
    data: [{
        "id": 1,
        "abbr": "AL",
        "name": "Alabama",
        "completed":false
    }, {
        "id": 2,
        "abbr": "AK",
        "name": "Alaska",
        "completed":false
    }, {
        "id": 3,
        "abbr": "AZ",
        "name": "Arizona",
        "completed":false
    }]
});

Ext.create('Ext.grid.Panel', {
    renderTo: document.body,
    store: userStore,
    width: 400,
    height: 200,
    title: 'Application Users',
    columns: [{
        width: 25,
        align: 'left',
        xtype: 'checkcolumn',
        tdCls: 'checkBoxColum',
        dataIndex: 'completed',
        renderer: function (value, meta, record, row, col) {
            /* Permission Check */
            var me = this;

            if(record.data.id==1)
            {
                meta['tdCls'] = 'x-item-disabled';
            }else
            {
                meta['tdCls'] = '';
            }
            return new Ext.ux.CheckColumn().renderer(value);
        }
    }, {
        text: 'name',
        width: 100,
        sortable: false,
        hideable: false,
        dataIndex: 'name'
    }]
});
Run Code Online (Sandbox Code Playgroud)