Deleting TreeView Nodes
Environment
Product | Progress® KendoReact |
Description
Can I delete TreeView Nodes?
Solution
Create custom item rendering through TreeView's "item" property. Define the custom item outside of the main component.
Since the delete function will be within the main component where the TreeView is rendered, use React Context for passing reference to the function to the nodes. Within the custom item add a delete icon/button and on its onClick event, return the props (where the item info is accessible).
Following is an example demonstrating the approach: