How To Select Only One Group Of TreeView Branches At A Time

Posted by: dharric on 8 August 2018, 5:45 am EST

    • Post Options:
    • Link

    Posted 8 August 2018, 5:45 am EST - Updated 3 October 2022, 11:24 am EST

    I have a react app using a treeview with checkboxes enabled. It works fine but if I select one branch of a tree and then select a different branch, the first branch that was selected remains selected. I would like the control to automatically deselect any checkboxes that were already selected and then select the new branch of checkboxes. Is this possible? In this screenshot I want the bottom Risk checkbox deselected if Investor Relations or one of it’s children is selected.

  • Posted 8 August 2018, 8:23 pm EST

    Hi,

    You may achieve the required functionality by handling the isCheckedChanged event and then unselecting/unchecking the required node.

    Please refer to the following sample which implements the same:-

    https://stackblitz.com/edit/react-jg6psr?file=index.js

    ~Manish

  • Posted 9 August 2018, 3:35 am EST

    Works great thanks

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels