How to Render Complex Tree With Collapsed Nodes in JavaScript Diagram?
In our Syncfusion® JavaScript Diagram, layout nodes can be both expanded and collapsed. By default, child nodes are expanded. If you want to display a complex hierarchical tree with child nodes collapsed, set the parent node’s isExpanded property to false.
index.js
function getNodeDefaults(obj) {
if (obj.data.Name === 'node12' || obj.data.Name === 'node22') {
obj.isExpanded = false;
}
return obj;
}
Refer the below sample for your reference
Sample: Click here
Conclusion
I hope you enjoyed learning about how to render complex tree with collapsed nodes in JavaScript Diagram.
You can refer to our JavaScript Diagram feature tour page to know about its other groundbreaking feature representations and documentation, and how to quickly get started for configuration specifications.
You can also explore our JavaScript Diagram Example to understand how to create and manipulate data.
For current customers, you can check out our components from the License and Downloads page. If you are new to Syncfusion®, you can try our 30-day free trial to check out our other controls.
If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our support forums, Direct-Trac, or feedback portal. We are always happy to assist you!