单击 GWT 中的 TreeNode 时如何显示子节点

发布于 2024-12-18 06:06:28 字数 96 浏览 5 评论 0原文

我正在使用 CellTree 显示来自 dataProvider 的数据。实际上,我通过单击箭头来显示节点的子节点。有没有办法通过单击节点本身来做到这一点?

谢谢

I'am using a CellTree to display data from a dataProvider. Actually I display the children of a node by clicking on the arrow. Is there a way to do so by clicking on the the node it self ?

Thank you

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

北斗星光 2024-12-25 06:06:28

仅凭记忆,恐怕没有简单的方法。您必须从 根节点向下走直到找到所选值。您可以安全地使用 setChildOpen(index, true) 沿着树走下去,因为单击树节点意味着它的所有父节点都已经打开,因此 setChildOpen 将始终返回节点的 TreeNode 以便您可以探索其子节点的值)。

From memory only, I'm afraid there's no easy way. You'd have to start from the root node and walk down until you find the selected value. You can safely use setChildOpen(index, true) here to walk down the tree, because clicking on a tree node means all its parent are already open, so setChildOpen will always return the TreeNode for the node so you can explore its children's value).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文