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());
}
在应用样式之前,必须使用ensureInjected()
:
MyResrouces.INSTANCE.MyCSS().ensureInjected()
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.