最初绘制树形网格时,如何使用 smartgwt 滚动到树形网格中的特定记录?
我需要绘制一个树网格,最初选择并滚动到特定记录。我尝试了以下代码。选择有效,但滚动无效。解决办法是什么?
treeGrid.addDataArrivedHandler(new DataArrivedHandler() {
public void onDataArrived(DataArrivedEvent event) {
TreeNode node = treeGrid.getData().find("ID", id);
treeGrid.selectRecord(node);
treeGrid.scrollToRow(treeGrid.getRecordIndex(node));
}
}
});
I need to draw a tree grid with selecting and scrolling to a specific record initially. I tried the following code. The selection works, but the scrolling doesn't. What is the solution?
treeGrid.addDataArrivedHandler(new DataArrivedHandler() {
public void onDataArrived(DataArrivedEvent event) {
TreeNode node = treeGrid.getData().find("ID", id);
treeGrid.selectRecord(node);
treeGrid.scrollToRow(treeGrid.getRecordIndex(node));
}
}
});
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我对 ListGrid 遇到了同样的问题,并通过将 scrollToRow 命令包装在以下内容中解决了它:
解决方案找到 在这里。
I had the same problem with a ListGrid and solved it by wrapping the scrollToRow command in this:
solution found here.
现在 DeferredCommand 已被弃用,所以......
会更好。
now DeferredCommand is deprecated, so...
will be better.