【发布时间】:2012-06-26 15:27:11
【问题描述】:
我想根据 CellTable(或 DataGrid)中“行”值的值来确定是否使用图标。在构建 Cell 渲染器时如何确定?
IconCellDecorator<String> icd = new IconCellDecorator<String>(res.search(), new ClickableTextCell()) {
@Override
protected boolean isIconUsed(String value) {
//value may not be unique across rows (column value), I really need the row instance here.
}
};
【问题讨论】:
-
在我看来,我真的希望装饰器采用我的行类型,但是 ClickableTextCell 不知道如何获取它需要的字符串值。看来我必须编写一个自定义 IconCellDecorator,但认为可能有更清洁的解决方案。
-
刚刚意识到 render() 有一个提供索引和键的上下文......认为这可能会有所帮助。
标签: gwt datagrid render cell celltable