We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Remove and Refresh Node

Thread ID:





142433 Feb 4,2019 01:06 PM UTC Feb 6,2019 12:43 PM UTC ASP.NET MVC - EJ 2 3
Tags: Treeview
Abhishek Verma
Asked On February 4, 2019 01:06 PM UTC

Dear team,
          I want to  remove Tree view Node,but we can't.In your documentation got a Code but it's also not working 

(var instance= document.getElementById("tree").ej2_instances[0];

Please Provide any solution.

Abhishek verma

Christopher Issac Sunder K [Syncfusion]
Replied On February 5, 2019 11:54 AM UTC

Hi Abhishek, 
Thank you for contacting Syncfusion support. 
In our TreeView component, you can use removeNodes method to remove single, multiple or all the tree nodes. For removing single/ multiple nodes you can either pass the tree id or tree node element in the removeNodes method. For removing all the nodes, you can pass the treeview component’s root ul element. We have prepared a sample for your reference. In this sample, we have removed a single node and the entire tree nodes on separate button click. Please check below code block and sample, 
var treeObj = document.getElementById('tree').ej2_instances[0]; 
//removes single tree node of id '6' 
//removes all tree nodes 
Please let us know if you have any concerns. 

Abhishek Verma
Replied On February 5, 2019 01:05 PM UTC

Dear team,
     When i am Remove All Node It's Give Error and Time of single Remove node visual it's Deleted But Memory still  Contain Remove Nodes.

Abhishek Verma

Christopher Issac Sunder K [Syncfusion]
Replied On February 6, 2019 12:43 PM UTC

Hi Abhishek, 

Thank you for contacting Syncfusion support. 

You have mentioned that on removing all nodes, error is being thrown. It would help us to identify your problem better if you could provide us the below details, 
  • Details of the error
  • Code block used to remove nodes
  • Scenario in which you have used this code

Also, you have mentioned that while removing single node, it is still maintained in memory. Could you please let us know in which memory you can see the removed node getting maintained? 
These details would give us information to find out your issue and help you resolve it. 



This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon