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
close icon

How to fill child nodes of the selected node at run time dynamically. How to populate tree view children on Click

I am using ASP.NET MVC EJ2 (Essential JS2) and I need your help to find a good example on how to populate TreeView nodes at run time after a specific node is selected.
in other words, I need to load children of a node after the node is selected. because I am trying to render a huge amount of
nodes that have very slow performance.

Kind Regards,

1 Reply

SA Shameer Ali Baig Sulaiman Ali Baig Syncfusion Team December 19, 2019 09:49 AM UTC

Hi Eman, 
Thanks for contacting Syncfusion support. 
In EJ2 TreeView control, we have provided loadOnDemand property. It loads first level nodes initially, and when parent node is expanded, it loads the child nodes based on the ParentID/Child member. 
By default, the load on demand (Lazy load) is set to true. By disabling this property, all the tree nodes will be rendered on the initial loading. 
Please, check the sample below in which collapsed nodes will not contain children nodes until the parent node is expanded. 
Please let us know if you need any further assistance. 
Shameer Ali Baig S. 

Live Chat Icon For mobile
Up arrow icon