0

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

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;
}

带有我的代码的图像

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

我需要这个

这可能吗?

谢谢,克劳迪奥。

4

1 回答 1

0

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

所以这:

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

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

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

.redUnderlinedText . x-grid-cell {
    background-color: blue !important;
    color: red;
    text-decoration: underline;
    cursor: pointer;
}
于 2012-09-26T22:07:37.947 回答