YUI TreeView 选择在重新创建时被破坏

发布于 2024-08-28 02:12:14 字数 131 浏览 3 评论 0原文

我有一个 YUI Treeview,允许使用复选框进行选择。经过一些操作后,我销毁了树(使用tree.destroy()),然后使用相同的containerID创建一棵新树。这个新树应该允许使用复选框进行选择,但事实并非如此。可能是什么原因造成的?

I have a YUI Treeview that allows selection with checkboxes. After some operations, I destroy the tree (with tree.destroy()), and then create a new tree using the same containerID. This new tree should allow selection using checkboxes, but does not. What could be causing this?

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

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

发布评论

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

评论(1

木落 2024-09-04 02:12:14

如果您有一些代码,那会很有帮助,但一般来说,destroy 方法会清理 JavaScript 方面的内容(侦听器等),但不一定会清理所有内容标记。如果你想使用相同的 ID,它会考虑从 DOM 中删除该 ID 以清除它的所有子项,然后重新创建它,然后构建树。我猜这不是很有帮助,但也许如果您能多解释一下您的用例,我可以提供一些更好的建议。

If you've got some code, that'd be helpful, but in general the destroy method cleans up the JavaScript side of things (listeners, etc.), but doesn't necessarily clean up all of the markup. If you want to use the same ID, it'd consider removing that ID from the DOM to clean out all of it's children and then recreating it and then building the tree. I'm guessing that's not super helpful, but maybe if you can explain your use case a little more, I can offer some better suggestions.

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