我如何改变extjs网格的背景颜色

时间:2012-09-26 18:32:52

标签: javascript extjs4

我需要更改网格单元格的背景,用我的代码更改文本颜色:

getRowClass: function(record, rowIndex, rowParams, store){
var grupo = record.get("tipo");
   if (grupo == 'G'){
   console.log('Grupo');
   return 'redUnderlinedText';
}

.redUnderlinedText {
    background-color: blue;// <= this code doesn't work
    color: red;
    text-decoration: underline;
    cursor: pointer;
}

image with my code

但我想更改单元格的背景,如下所示。

I need this

这可能吗?

感谢, 克劳迪奥。

1 个答案:

答案 0 :(得分:0)

奇怪的是,您在网格上看到的背景是每个单元样式的结果。

所以这个:

.x-grid-cell {
    background-color: red;
}

应该适用于所有未选择的单元格。

在你的情况下,我会尝试:

.redUnderlinedText . x-grid-cell {
    background-color: blue !important;
    color: red;
    text-decoration: underline;
    cursor: pointer;
}