Vaadin,改变网格列颜色

时间:2016-06-07 09:52:11

标签: css grid themes vaadin vaadin7

我想更改网格的列颜色。不幸的是没有任何反应......这是我的代码:

grid.setCellStyleGenerator(( Grid.CellReference cellReference ) -> {
            if ( "name".equals( cellReference.getPropertyId() ) ) {
                return "highlight-green";
            } else {
                return "rightAligned";
            } 
        });

mytheme.scss:

@import "../valo/valo.scss";

@mixin mytheme {
  @include valo;

  // Insert your own theme rules here

  .rightAligned {
      text-align: right;
  }

 .v-table-row.v-table-row-highlight-green,
 .v-table-row-odd.v-table-row-highlight-green {
      background-color: #00ff00;
  }
}

rightAligned效果很好,但highlight-green没有

1 个答案:

答案 0 :(得分:0)

尝试添加background-color: #00ff00 !important;

看起来您需要重写框架的现有样式,!important必须对此有所帮助。