我有一个简单的extjs grid如下图:我希望当Progress的值小于100%的时候, 把整行的数据都用红色标注. 我也参照官网的例子, 给grid加一个viewConfig如下:
viewConfig: {
forceFit: true,
getRowClass: function(record, index) {
var progress = record.get('progress');
if(progress!=100){
return '-red';
}
else{
return '';
}
}
}
但是我发现我定义的样式'-red'无法改变字体的颜色. 有经验的人给点建议.谢谢.
viewConfig: {
forceFit: true,
getRowClass: function(record, index) {
var progress = record.get('progress');
if(progress!=100){
return '-red';
}
else{
return '';
}
}
}
但是我发现我定义的样式'-red'无法改变字体的颜色. 有经验的人给点建议.谢谢.
如是 .slet .slet span或是i什么的或是不写看你的源码了{color:#xxx}.slet{color:#xxx}
.red-row
{
background-color: #F5C0C0 !important;
}
viewConfig: {
forceFit: true,
enableRowBody: true,
getRowClass: function(record, rowIndex, p, ds) {
var isBargain = record.data["IsBargain"], cls = "white-row";
if (isBargain == true) {
cls = "red-row";
}
return cls;
}
},
-red像这样写就可以了:
.-red table{
color: red;
}