How to Implement Tree view multiple select nodes with Delete and Rename nodes at once

Hi Team,

I have allowed my Angular treeview to select multiple nodes.
But when when I am trying delete or Rename using context menu on right click of node only last node able to delete or rename.

Is there any possibility to delete multiple nodes at once using context menu.
If yes, please share us the sample.

Thanks,
Shiva  

1 Reply

SP Sowmiya Padmanaban Syncfusion Team May 6, 2020 11:29 AM UTC

Hi Samba, 
 
Greetings from Syncfusion support. 
 
We have checked your reported query with TreeView component. Yes, it is possible to delete the multiple node in TreeView component. You can get the selected node of TreeView component by using SelectedNodes property. And then you can pass the selected node value in removeNodes method of TreeView component in the select event of context menu component . 
 
Refer the below code snippet. 
public menuclick(args: MenuEventArgs) { 
    let targetNodeId: any = this.treevalidate.selectedNodes; 
    if (args.item.text == "Remove Item") { 
        this.treevalidate.removeNodes(targetNodeId);   
    } 
} 

Refer the sample link below. 
 
Refer the below link to know more about the TreeView component. 
 
 
 
 
Please let us know, if you have need any further assistance on this. 
 
Regards,  
Sowmiya. P 


Loader.
Up arrow icon