我有一个简单的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'无法改变字体的颜色. 有经验的人给点建议.谢谢.

解决方案 »

  1.   

    用dug工具看看被选中的行,用的CLASS名叫什么,然再你再那个名下追加一个不就行了
    如是 .slet .slet span或是i什么的或是不写看你的源码了{color:#xxx}.slet{color:#xxx}
      

  2.   

    /*grid行标红样式*/
    .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;
                                }
                            },
      

  3.   

    谢谢3位, 我已经找到解决方法了:
    -red像这样写就可以了:
    .-red table{
    color: red;
    }