Extjs更改网格中单元格轮廓的颜色
根据此单元格中的可编辑值更改网格中单元格轮廓的颜色。我知道您需要侦听器“更改”/“更改后”编辑css样式。告诉我怎么做Extjs更改网格中单元格轮廓的颜色,extjs,grid,cell,Extjs,Grid,Cell,根据此单元格中的可编辑值更改网格中单元格轮廓的颜色。我知道您需要侦听器“更改”/“更改后”编辑css样式。告诉我怎么做 columns: [{ text: 'code', dataIndex: 'code', flex: 1, align: 'center' }, { text: 'source', hidden: true, dataInde
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;
}
这将不起作用,请参阅示例代码,我在上面添加