Extjs 如何使用listener函数隐藏操作列特定图标
我想在网格中单独显示特定用户的图标。我想在listener函数中编写此函数。可以根据条件使用getClass隐藏图标。但我不确定这是否是你想要的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
{
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”