我在树网格面板上有一个操作列定义,我想在文件夹上隐藏操作图标,但在叶节点中显示不同的图标,我成功地做到了,但是,当我应用“x-hide-display”时样式我还注意到列本身被隐藏了,我只想在每列中显示图标。谢谢
this.columns = [{
xtype: 'treecolumn', //this is so we know which column will show the tree
text: 'Folder',
flex: 1,
sortable: true,
dataIndex: 'folder'
},{
text: '',
width: 20,
menuDisabled: true,
xtype: 'actioncolumn',
tooltip: 'View Chats',
align: 'center',
items:[{
icon: 'resources/images/comment.png',
getClass: function(value, metaData, record){
if(record.raw.leaf)
metaData.css = 'x-grid-icon'
else
metaData.css = 'x-hide-display';
}
}]
},{
text: '',
width: 20,
menuDisabled: true,
xtype: 'actioncolumn',
tooltip: 'View Alerts',
align: 'center',
items:[{
icon: 'resources/images/alert.png',
getClass: function(value, metaData, record){
if(record.raw.leaf)
metaData.css = 'x-grid-icon'
else
metaData.css = 'x-hide-display';
}
}]
},{
text: '',
width: 20,
menuDisabled: true,
xtype: 'actioncolumn',
tooltip: 'Favorite',
align: 'center',
items:[{
icon: 'resources/images/favorites.png',
getClass: function(value, metaData, record){
if(!record.raw.leaf)
metaData.css = 'x-grid-icon'
else
metaData.css = 'x-hide-display';
}
}]
},{
text: '',
width: 20,
menuDisabled: true,
xtype: 'actioncolumn',
tooltip: 'Share',
align: 'center',
items:[{
icon: 'resources/images/share.png',
getClass: function(value, metaData, record){
if(!record.raw.leaf)
metaData.css = 'x-grid-icon'
else
metaData.css = 'x-hide-display';
}
}]
}]