有时候需要根据特定的条件改变grid某一行的背景色,所以就可以使用renderer方法
{
"text": "参考值",
flex: 1,
"dataIndex": "REFERENCE",
editor: {
xtype: 'textfield',
},
'minWidth': 120,
renderer: function (v, f, record) {
//这里可以根据v或者record来获取不同的值进行条件判断,然后进行格式的改变。
/* if (v === '0') {
return '<a style="text-decoration: underline;color: blue;cursor:pointer">' + '临时保存' + '</a>';
} else if (v === '1') {
return '已提交';
}*/
f.tdStyle = 'background-color:#ebef17a3';
return v//一定要记得返回值否则就是空的数据。
}
},