Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/extjs/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Extjs 如何使用listener函数隐藏操作列特定图标_Extjs - Fatal编程技术网

Extjs 如何使用listener函数隐藏操作列特定图标

Extjs 如何使用listener函数隐藏操作列特定图标,extjs,Extjs,我想在网格中单独显示特定用户的图标。我想在listener函数中编写此函数。可以根据条件使用getClass隐藏图标。但我不确定这是否是你想要的 { xtype: 'actioncolumn', items: [{ icon: '/images/your_icon.png', getClass: function(value, meta, record) { if(record.get('user') === 'your_u

我想在网格中单独显示特定用户的图标。我想在listener函数中编写此函数。

可以根据条件使用getClass隐藏图标。但我不确定这是否是你想要的

{
    xtype: 'actioncolumn',
    items: [{
        icon: '/images/your_icon.png',
        getClass: function(value, meta, record) {
            if(record.get('user') === 'your_user') {
                return 'x-hide-visibility';
            }
        }
    }]
}

这是特定于操作列的,以防上述解决方案不起作用。因为它不适合我。这可能有用

{   
            xtype: 'actioncolumn',
            items : [{
                icon : 'imagepath',
                scope: this,
                handler : function(grid, rowIndex, colIndex) {
                    //if you need one   
                },
                getClass : function(value, meta, record, rowIx, ColIx, store) {
                    // Determines at runtime whether to render the icon/link
                    return (record.data.user === 'your_user') ?
                            'x-grid-center-icon': //Show the action icon
                            'x-hide-display';  //Hide the action icon
                }
            }]
        }

对于使用extjs5的用户,“x-hide-visibility”已更改为“x-hide-visibility”