Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/extjs/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
ExtJs4更改Statuscode上的字段颜色_Extjs_Grid_Extjs4_Field_Cell - Fatal编程技术网

ExtJs4更改Statuscode上的字段颜色

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 {

您好,我正在与ExtJs抗争,我正在尝试在ExtJs网格中更改颜色,其中单元格名称为“statuscode”,如果statuscode为1,则单元格必须更改为绿色!有人有主意吗?谢谢

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样式

还可以查看元参数,该参数授予对所需特定单元格样式的访问权限