Monday, October 19, 2009

How to set the grid row style?

Well the column style can be set using the GridCellRenderer, but there is a completely different way to set the style of a row.

GridViewConfig gvc = new GridViewConfig(){
public String getRowStyle(ModelData model, int rowIndex, ListStore ds) {
    return "row-Style";  // Style to be set to a row
  }
};
grid.getView().setViewConfig(gvc);

User specific conditions can be checked in getRowStyle to set different styles to different rows.