DataGrid / CellTable Modeling Complexity - Overriding Row Styles

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.

+5
2

CSS DataGrid . , DataGrid.Resources, CSS. datagrid.

, DataGrid. ( , , GWT).

public interface MyStyle extends DataGrid.Style {
}

, dataGridStyle() DataGrid.Resources. dataGridStyle MyStyle.

, @Source: CSS (DataGrid.css) , ( "DataGridOverride.css" ).

public interface DataGridResource extends DataGrid.Resources {

  @Source({ DataGrid.Style.DEFAULT_CSS, "DataGridOverride.css" })
  MyStyle dataGridStyle();
};

, :

DataGridResource resource = GWT.create(DataGridResource.class);
    dataGrid = new DataGrid<T>(pageSize, resource)

, , , , , .

+11

. http://code.google.com/p/google-web-toolkit/issues/detail?id=6144#c3 ( !)

, DataGrid.Style ( , , ), dataGridStyle , DataGrid.Style ( - )

+3

All Articles