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
Extjs更改网格中单元格轮廓的颜色_Extjs_Grid_Cell - Fatal编程技术网

Extjs更改网格中单元格轮廓的颜色

Extjs更改网格中单元格轮廓的颜色,extjs,grid,cell,Extjs,Grid,Cell,根据此单元格中的可编辑值更改网格中单元格轮廓的颜色。我知道您需要侦听器“更改”/“更改后”编辑css样式。告诉我怎么做 columns: [{ text: 'code', dataIndex: 'code', flex: 1, align: 'center' }, { text: 'source', hidden: true, dataInde

根据此单元格中的可编辑值更改网格中单元格轮廓的颜色。我知道您需要侦听器“更改”/“更改后”编辑css样式。告诉我怎么做

      columns: [{
         text: 'code', 
        dataIndex: 'code', 
        flex: 1, 
        align: 'center' }, 
        { 
       text: 'source', 
        hidden: true, 
        dataIndex: 'code_source', 
        flex: 2, align: 'center', 
        renderer: function (value, metaData) { metaData.tdAttr = 'data-qtip="' + 
       value + '"'; return value; } }, 
        { text: 'value', 
        dataIndex: 'value', 
        flex: 3, 
        align: 'center', 
        editor: { xtype:'textfield', allowBlank: false, minLength: 1, maxLength: 
        255 }, 
       renderer: function (value, metaData) { if(!value){ value = ''; } 
       metaData.tdAttr = 'data-qtip="' + value + '"'; return value ? value : ''; 
       } 
}]

您可以使用网格列中的
渲染器
函数更改列的样式

renderer : function(value, meta) {
    if(value === "smth") {
        meta.style = "border-color:green;border-width:2px"; // extra style here
    }
    return value;
}

这将不起作用,请参阅示例代码,我在上面添加