如何将GWT CellTable用于以下布局
每一行都有一个checkBox和一个标签/HTML内容。
提前谢谢。
发布于 2011-05-20 17:29:41
首先,创建一个这样的类
public class MyObject{
private CheckBox checkBox;
private HTML html;
public Contact(CheckBox checkBox, HTML html) {
this.checkBox = checkBox;
this.html = html;
}
// getter & setter
}在创建单元格表之后
CellTable<MyObject> cellTable = new CellTable<MyObject>();然后创建列
TextColumn<MyObject> firstColumn = new TextColumn<MyObject>() {
@Override
public CheckBox getValue(MyObject object) {
return object.getCheckBox;
}
};
cellTable.addColumn(firstColumn , "Checkbox");和第二列
TextColumn<MyObject> secondColumn = new TextColumn<MyObject>() {
@Override
public HTML getValue(MyObject object) {
return object.getHtml;
}
};
cellTable.addColumn(secondColumn , "HTML");https://stackoverflow.com/questions/6069700
复制相似问题