I try very hard to fine-tune my GWT 2.4 DataGrid and hit roadblocks at every step. I added the following row style to my DataGrid:
dataTable.setRowStyles(new RowStyles<IntegrityItem>() {
@Override
public String getStyleNames(IntegrityItem row, int rowIndex) {
if (row.getSomeValue() >= 100) {
return MyResources.INSTANCE.mystyles().alertRow();
} else {
return "";
}
}
});
The alertRow style is simple:
.alertEntry {
font-weight: bold;
color: #00ff00;
background-color: #ff0000;
}
Additional info: I created a local copy of DataGrid.css and removed all the "background" elements from all the styles, and I used this to create the ClientBundle:
public interface MyDataGridResources extends DataGrid.Resources {
public static final FmeaDataGridResources INSTANCE = GWT.create(MyDataGridResources.class);
@Override
@Source({"../resources/styling/mydatagridstyles.css"})
Style dataGridStyle();
}
I used this (MyDataGridResources.INSTANCE) in my DataGrid constructor.
, , , (# 00ff00), , . , ? ?! css.