user2395505
user2395505

Reputation: 13

GWT DataGrid specific row needs add style

is anyone have idea ,how to add specific style to GWT Datagrid? I need to add style to specific row ( class="error") to show that row in red color. More details:

Rendering the table using the GWT Datagrid. it has column called "type" . the type can have different values like " connected" ,"disconnected" ,"error". if the type is error then i need to render row with different style( need to show text in the red color).

Upvotes: 0

Views: 2500

Answers (1)

Thomas Broyer
Thomas Broyer

Reputation: 64561

There's RowStyles for that exact purpose.

grid.setRowStyles(new RowStyles<Row>() {
  @Override
  public String getStyleNames(Row row, int rowIndex) {
    return "error".equals(row.getType()) ? "error" : "";
  }
});

Upvotes: 5

Related Questions