Sencha Grid和Action Column

Mig*_*ira 1 grid extjs extjs4.1

我在网格上有这个:

{                xtype: 'actioncolumn',
            renderer: function (val, metadata, record) {
                if (record.raw.possibleActions != 2) {
                    this.items[0].icon = '';
                    this.items[0].tooltip = '';
                }

                metadata.style = 'cursor: pointer;';
                return val;
            },
            width: 30,
            align: 'center',
            sortable: false,
            items: [{
                icon: 'images/edit.png',
                tooltip: 'stuff',
                handler: function (grid, rowIndex, colIndex) {
                    'do stuff'
                }
            }]
        },
Run Code Online (Sandbox Code Playgroud)

当字段"possibleActions"不同于2时,我想要隐藏动作列的图标.

有了这个,this.items[0].icon = '';它将从所有列中删除图标......

如何访问与条件匹配的特定行的列?

Mig*_*ira 5

我已经解决了:

renderer: function (val, metadata, record) {
                if (record.raw.possibleActions != 2) {
                    this.items[0].icon = '';
                    this.items[0].tooltip = '';
                } else {
                    this.items[0].icon = 'images/edit.png';
                    this.items[0].tooltip = 'RELATÓRIO FINAL';
                }

                metadata.style = 'cursor: pointer;';
                return val;
            },
Run Code Online (Sandbox Code Playgroud)

似乎渲染器覆盖了初始配置,这就是为什么所有记录都没有图标的原因.