Extjs checkcolumn disable for some rows, based on value

前端 未结 5 1454
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-16 14:07

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_chec

5条回答
  •  清酒与你
    2020-12-16 14:50

    I also ran into this problem and to take it a step further I needed to have a tooltip show over the checkbox. Here's the solution I came up with that seems to be the least invasive on the existing checkcolumn widget...

    renderer: function (value, metaData, record) {
        // Add a tooltip to the cell
        metaData.tdAttr = (record.get("someColumn") === "") ? 'data-qtip="A tip here"' : 'data-qtip="Alternate tip here"';
    
        if (record.get("someColumn") === "") {
            metaData.tdClass += " " + this.disabledCls;
        }
    
        // Using the built in defaultRenderer of the checkcolumn
        return this.defaultRenderer(value, metaData);
    }
    

提交回复
热议问题