Results 1 to 2 of 2

Thread: Color Grid Rows

  1. #1
    Sencha User
    Join Date
    Oct 2009
    Posts
    40

    Default Color Grid Rows

    Hello,
    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?
    Regards
    Baczek00

  2. #2
    Sencha User
    Join Date
    Jul 2011
    Location
    Germany
    Posts
    223

    Default

    In GXT3, ColumnConfig has setCell(myCell) rather hat setRenderer(myRenderer).

    How to create a Cell and get access to the store within it, has been discussed here recently:

    http://www.sencha.com/forum/showthre...on-a-grid-cell

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •