CSS style for CellList

I created a CellList at my entry point. Now I want to style it (change the color of the selected cell from blue to dark black)

As far as I know, I only need to override the cellList style, select the selected one and change the background color (and then save inside module.css)

So this is what I came with.

@sprite .cellListSelectedItem {
/*gwt-image: 'cellListSelectedBackground';*/
/*BEFORE : background-color: #628cd5;*/
background-color: #2D2D2D;
color: white;
height: auto;
overflow: visible;
}

However, every time I select a cell, it still displays the old color (# 628cd5). Anything I did wrong?

And yes, I cleared the project and restarted the server, and also cleared the browser cache.

+2
source share
1 answer

You need to tell GWT to use the new styles - just adding them to your CSS module file will not be enough:

table = new CellTable<FooType>(12,
    CellTableResources.INSTANCE, keyProvider);

CellTableResources.INSTANCE , CellTable. - :

import com.google.gwt.core.client.GWT;
import com.google.gwt.resources.client.ImageResource;
import com.google.gwt.resources.client.ImageResource.ImageOptions;
import com.google.gwt.resources.client.ImageResource.RepeatStyle;
import com.google.gwt.user.cellview.client.CellTable;
import com.google.gwt.user.cellview.client.CellTable.Style;

public interface CellTableResources extends CellTable.Resources {

  public static CellTableResources INSTANCE = GWT.create(CellTableResources.class);

  @Source("footer_bg.png")
  @ImageOptions(repeatStyle = RepeatStyle.Both, flipRtl = true)
  ImageResource cellTableFooterBackground();

  @Source("header.png")
  @ImageOptions(repeatStyle = RepeatStyle.Horizontal, flipRtl = true)
  ImageResource cellTableHeaderBackground();

  @Source("table_head_bg_left.png")
  @ImageOptions(repeatStyle = RepeatStyle.None, flipRtl = true)
  ImageResource cellTableHeaderFirstColumnBackground();

  @Source("table_head_bg_right.png")
  @ImageOptions(repeatStyle = RepeatStyle.None, flipRtl = true)
  ImageResource cellTableHeaderLastColumnBackground();

  @Source(CellTableStyle.DEFAULT_CSS)
  Style cellTableStyle();
}

, , CellTableStyle :

import com.google.gwt.user.cellview.client.CellTable;

public interface CellTableStyle extends CellTable.Style {

   String DEFAULT_CSS = "path/to/your/new/CellTable.css";

   String cellTableCell();

   // ....

}
+4

All Articles