Hello,
I have a data grid and I would like more on this grid to distinguish the color of some rows.
How to do it in EXT-GWT 3.1.1?
Color Grid Rows
I have a data grid and I would like more on this grid to distinguish the color of some rows.
The color depends on the data rows in the grid.
The EXT-GWT 2.2.5 I've done it like this:
Code:
@Override
public final void addGridColumn(String ColumnDatabaseName, String ColumnName, Integer ColumnSize) {
final String cm = ColumnName;
GridCellRenderer<ModelData> colorRow = new GridCellRenderer<ModelData>() {
@Override
public String render(ModelData model, String property, ColumnData config, int rowIndex, int colIndex, ListStore<ModelData> store, Grid<ModelData> grid) {
String val = (String) model.get(property);
if (val == null) {
val = "";
}
String valColor = (String) model.get("ZALEGLE");
String style = valColor != null ? "red" : GXT.isHighContrastMode ? "#00ff5a" : "#000000";
return "<span qtitle='" + cm + "' qtip='" + val
+ "' style='font-weight: normal;color:" + style + "'>" + val + "</span>";
}
};
ColumnConfig column = new ColumnConfig();
column.setHeader(ColumnName);
column.setId(ColumnDatabaseName.toUpperCase());
column.setWidth(ColumnSize);
column.setRenderer(colorRow);
addGridColumnCustom(column, true);
How to do it in EXT-GWT 3.1.1?
Color Grid Rows
Aucun commentaire:
Enregistrer un commentaire