我最初需要通过选择和滚动到特定记录来绘制树形网格。我尝试了以下代码。选择有效,但滚动无效。解决办法是什么?
treeGrid.addDataArrivedHandler(new DataArrivedHandler() {
public void onDataArrived(DataArrivedEvent event) {
TreeNode node = treeGrid.getData().find("ID", id);
treeGrid.selectRecord(node);
treeGrid.scrollToRow(treeGrid.getRecordIndex(node));
}
}
});