gpt4 book ai didi

javascript - 如何在 JSTree 中独立 "check/uncheck"节点 "child/parent"?

转载 作者:行者123 更新时间:2023-11-29 17:13:04 25 4
gpt4 key购买 nike

我需要可以独立检查父节点和子节点。例如,如果我的树有一个带有子节点的节点,则组件是:

如果我检查这个 child , parent 也会自动检查,反之亦然。我想可以检查一个 child 或 parent ,而不改变另一个。

我怎样才能“移除”两者的这种依赖关系?

感谢任何帮助。

提前致谢!

最佳答案

我在自己的 jstree 网站上找到了问题的答案:

link

two_state A boolean. Default is false. If set to true checkboxes will be two-state only, meaning that you will be able to select parent and children independently and there will be no undetermined state.

所以,我把下面的选项解决了我的问题:

"checkbox" : { 
"two_state" : true
}

注意

关于javascript - 如何在 JSTree 中独立 "check/uncheck"节点 "child/parent"?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20359819/

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