gpt4 book ai didi

gwt - CellList 小部件数量不能超过 25

转载 作者:行者123 更新时间:2023-12-01 02:35:34 24 4
gpt4 key购买 nike

我已经在 CellList 上工作了几个星期,我发现它很糟糕。

那些天我想打印一个包含超过 70 个元素的列表,但我注意到我的 CellList 没有附加超过 25:从 0 到 24。为了确保问题与我的项目没有 relashionsip,我决定测试新的和氏族项目中的代码但它具有相同的结果。

这是我的代码:

CustomCell bodyCell = new CustomCell();
CellList<String> coreCellList = new CellList<String>(bodyCell);
List<String> list = new ArrayList<String>();
for (int i=0; i<74; i++) {
list.add("hello_"+i);
}
coreCellList.setRowData(0, list);
coreCellList.setRowCount(list.size(), true);

RootPanel.get().add(coreCellList);

和自定义单元格:
public class CustomCell extends AbstractCell<String> {
interface Templates extends SafeHtmlTemplates {

String style = "cell";

@SafeHtmlTemplates.Template("<div class=\"" + style
+ "\" style = 'height : 15%'>{0}<br/></div>")
SafeHtml cell(SafeHtml value);
}

private static Templates templates = GWT.create(Templates.class);

@Override
public void render(com.google.gwt.cell.client.Cell.Context context,
String value, SafeHtmlBuilder sb) {
SafeHtml safeValue = SafeHtmlUtils.fromString(value);

SafeHtml rendered = templates.cell(safeValue);

sb.append(rendered);
}
}

感谢您的帮助。

最佳答案

当我不想分页时,我总是使用下面的代码传递我的 CellTables 和 CellLists。

public static void setupOnePageList(final AbstractHasData<?> cellTable) {
cellTable.addRowCountChangeHandler(new RowCountChangeEvent.Handler() {
@Override
public void onRowCountChange(RowCountChangeEvent event) {
cellTable.setVisibleRange(new Range(0, event.getNewRowCount()));
}
});
}

关于gwt - CellList 小部件数量不能超过 25,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10448944/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com