版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/inforstack/article/details/54237726
官网介绍
图标加载
getClass : Function A function which returns the CSS class to apply to the icon image. Parameters v : Object The value of the column's configured field (if any). metadata : Object An object in which you may set the following attributes: css : String A CSS class name to add to the cell's TD element. attr : String An HTML attribute definition string to apply to the data container element within the table cell (e.g. 'style="color:red;"'). r : Ext.data.Model The Record providing the data. rowIndex : Number The row index. colIndex : Number The column index. store : Ext.data.Store The Store which is providing the data Model.
AI 代码解读
提示加载
getTip : Function A function which returns the tooltip string for any row. Parameters v : Object The value of the column's configured field (if any). metadata : Object An object in which you may set the following attributes: css : String A CSS class name to add to the cell's TD element. attr : String An HTML attribute definition string to apply to the data container element within the table cell (e.g. 'style="color:red;"'). r : Ext.data.Model The Record providing the data. rowIndex : Number The row index. colIndex : Number The column index. store : Ext.data.Store The Store which is providing the data Model.
AI 代码解读
项目实战
text : "操作",
xtype:'actioncolumn',
sortable : false,
width : 190,
items : [{
handler : "projectFavorite",
name : 'projectFavorite',
getClass : function (v, metadata, r, rowIndex, colIndex, store) {
if (me.userType == '20') {
if (r.data.partaked){
return "x-item-disabled x-fa fa-heart";
} else {
return r.data.favorite == true ? "x-fa fa-heart" : "x-fa fa-heart-o";
}
}
},
getTip : function (v, metadata, r, rowIndex, colIndex, store) {
if (me.userType == '20') {
return r.data.favorite == true ? "取消关注" : "关注";
}
}
}]
AI 代码解读