react-component / tree-select

React Tree Select

Home Page:https://tree-select.react-component.now.sh/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Can I change the TreeSelect props on the fly?

Al-JeMay opened this issue · comments

Can I change the TreeSelect props on the fly? For example, I wanted to have 2 modes for this component, so user can freely switch between TreeSelect.SHOW_ALL and TreeSelect.SHOW_PARENT. From my understanding, I need to change the props of showCheckedStrategy & treeCheckStrictly to make this happen. Any Idea on how to dynamically change this two props?

MODE 1 : Select only parent
showCheckedStrategy = TreeSelect.SHOW_PARENT
treeCheckStrictly = true
image

MODE 2: Select parent and all its children
showCheckedStrategy = TreeSelect.SHOW_ALL
treeCheckStrictly = false
image

I managed to solve it; those two props are dynamically changeable :)