ExtJs4更改Statuscode上的字段颜色
您好,我正在与ExtJs抗争,我正在尝试在ExtJs网格中更改颜色,其中单元格名称为“statuscode”,如果statuscode为1,则单元格必须更改为绿色!有人有主意吗?谢谢ExtJs4更改Statuscode上的字段颜色,extjs,grid,extjs4,field,cell,Extjs,Grid,Extjs4,Field,Cell,您好,我正在与ExtJs抗争,我正在尝试在ExtJs网格中更改颜色,其中单元格名称为“statuscode”,如果statuscode为1,则单元格必须更改为绿色!有人有主意吗?谢谢 Ext.define('Shopware.apps.ArticleUpdateLog.model.ArticleUpdateLog', { extend: 'Shopware.data.Model', configure: function () { return {
Ext.define('Shopware.apps.ArticleUpdateLog.model.ArticleUpdateLog', {
extend: 'Shopware.data.Model',
configure: function () {
return {
controller: 'ArticleUpdateLog'
};
},
fields: [
{ name : 'id', type: 'int', useNull: true },
{ name : 'importTimestamp', type: 'string' },
{ name : 'statuscode', type: 'string', useNull: true },
{ name : 'status', type: 'string', useNull: true }
]
});
网格的每一列都有一个渲染器配置
render:function(value、meta、record)
。因此,您可以使用record.get('status')
检查当前值,并向给定单元格添加css样式
还可以查看元参数,该参数授予对所需特定单元格样式的访问权限