Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Change the Style of ListGridField Header

    Hi,
    So my requirement is to change the style of the ListGridField Header, I've tried overriding both the "getHeaderBaseStyle" as well as "getHeaderTitleStyle" but the style doesn't change for the Headers. I don't want to use a CSS file for modifying the Header. Does anyone have any suggestion for this?

    ListGridField field = new ListGridField("date", "Date", 70)
    {
    @Override
    public String getHeaderBaseStyle()
    {
    //String style = super.getBaseStyle();
    String style = "background-color:#F94336;";
    return style;
    }
    @Override
    public String getHeaderTitleStyle()
    {
    String style = "background-color:#F94336;";
    return style;
    }
    };

    #2
    Neither of these is documented as an override point, and these APIs work with CSS class names, not direct CSS definitions.

    You will need to define a named series of CSS styles to restyle the header, but these could be defined on the fly if they need to be dynamic.

    Comment


      #3
      Can you please help me understand, how to define the CSS on the fly? like I can create a CSS file with classes and use specific conditions in my code to choose any of the classes dynamically?

      Comment


        #4
        There are many approaches, but one is the core GWT API StyleInjector.inject().

        Comment

        Working...
        X