我在 GridView 中的每一行的操作列中有 3 个图标,编辑、删除、发布。 现在我想要的是在某些情况下隐藏发布图标并更改为取消发布图标。(我的记录来自 mysql 数据库)。
最佳答案
这是我项目中的一个例子。
使用 actioncolumn 项目的 getClass 属性来实现这一点。要隐藏它,请返回“x-hide-display”类名。
xtype: 'actioncolumn',
items: [
{
getClass: function(v, metadata, r, rowIndex, colIndex, store) {
// hide this action if row data flag indicates it is not deletable
if(r.data.deletable == false) {
return "x-hide-display";
}
},
handler: function(view, rowIndex, colIndex, item, e, record, row) {
//do something
},
icon: 'icons/delete.png'
}
]
]
关于javascript - 在 Extjs 4 中使用 getClass 隐藏操作列图标,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14689527/