Wednesday, June 20, 2012

Re: how to set the row color of CellTable based on values in a column

there is some progress, I use the code as follow:
// set RowStyles
table.setRowStyles(new RowStyles<Log>(){
@Override
public String getStyleNames(Log row, int rowIndex) {
if (row.getSeverity_cd().equalsIgnoreCase("W ")){
    return "warning";
}else if (row.getSeverity_cd().equalsIgnoreCase("C ")){
    return "critical";
}else
    return null;
}
});

and the result is shown as attached.

just feel the css need use something like following:
.critical{
   background-color:red !important;
}

which seem not normal css syntax (!important).

and I do not know where is the origin rowStyle come from (at first, I want to use CellTable.getRowStyles in else part but found not this api and so return null, so lucky the origin style still preserve, that is, if the row.getSeverity_cd() equals to other character than 'W ', 'C ', the origin style can preserve, but I do not know the background machanism).

 








--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/IPZJ7-Jn0_0J.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate