1

in gwt how do i change the style of checkboxcell? the checkboxcell is inside a gridtable and

datagrid.getColumn(0).setCellStyleNames(SomeCssClass.getMyCss());

does not work

here's a sample of my code

css:

  .checkBoxCss{
            height:25px;
        }

this is for java that extends CSSResource

public interface MyCSS extends CssResource {

    String checkBoxCss();

}

and this is for the Gridtable

class Gridtable{

public DataGrid<MyObject> createDatagrid(){


CheckboxCell myCheckbox= new CheckboxCell(true, false);

Column<MyObject, Boolean> checkCol = new Column<MyObject, Boolean>(myCheckbox) {
            @Override
            public Boolean getValue(MyObject object) {
                return object.isSelected();

            }
        };

}

datagrid.addColumn(checkCol, "Test");
datagrid.getColumn(0).setCellStyleNames(MyResrouces.INSTANCE.MyCSS().checkBoxCss());


}
Led
  • 662
  • 1
  • 19
  • 41

1 Answers1

0

You must use ensureInjected() before applying the style:

MyResrouces.INSTANCE.MyCSS().ensureInjected()
Philippe Gonday
  • 1,747
  • 5
  • 21
  • 32