idux
idux copied to clipboard
[comp:tree] 支持勾选所有子节点时,父节点为半勾选状态
- [x] I have searched the issues of this repository and believe that this is not a duplicate.
What problem does this feature solve?
场景: 父节点为空间,子节点为设备 勾选所有设备,父空间为半勾选状态 勾选父空间,空间下所有设备都勾选 即勾选策略为:父不关联,子关联
What does the proposed API look like?
cascade支持更多策略 父子关联、父子不关联、父关联子不关联、父不关联子关联
Translation of this issue:
[Comp: Tree] When supporting all sub -nodes, the parent node is half -checking status
- [X] I have searched the [issues] (https://github.com/iduxfe/idux/isSues) of this repository that this is not a duplicate.
What PROBLEM DOES This Feature Solve?
Scenes: Father nodes are space, sub -nodes are equipment Check all the equipment, the parent space is half -checking state Check the parent space, all the devices in the space are checked That is to check the strategy: the father is not associated, the child is related
What does the proposed api look like?
Cascade supports more strategies Father and son association, father and son are not associated, father -associated son is not associated, and father is not associated
这种联动比较复杂,对现有逻辑存在影响,组件不太好支持。 建议:
- 直接使用 不关联 的策略,
- 勾选所有设备,父空间为半勾选状态, 这种情况跟设计师沟通下,父空间就不显示半选了。
- 勾选父空间,空间下所有设备都勾选,这种比较容易实现,就是监听一下勾选事件,把父空间的所有设备的 key 丢到 checkedKeys 里去就好了。