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

how to open different component when clicking on each node of treeview insode sidenav control

We have a SideNav and within that we have a treeview, now we are going to show different components on the right side of sidenav when user clicks on each node.

We tried to use template and within that use <Link> but unfortunately it doesn't work .

Would you please advice how this is achievable and please provide a sample if possible?

Thanks in advance 

1 Reply

AB Ashokkumar Balasubramanian Syncfusion Team August 15, 2019 08:04 AM

Hello Afshin, 
Good day to you. 
For this use case, you can use our NavigateUrl attribute of fields property to store the corresponding component details and using nodeSelected event to display the corresponding content in Right Side panel of SideBar. Please refer the below code block and sample. 
this.dataList = [{ 
        "nodeId": "00", 
        "nodeText": "Overview", 
        "icon": "icon icon-dashboard", 
        "expanded": false, 
        "enabled": true, 
        "selected": false, 
        "navigateUrl": "https://account.teamyell.nl", 
        "tooltip": null, 
        "nodeChild": null 
    onSelect(args) { 
        var data = this.treeObj.getTreeData(args.node); 
        //Based on your requirement get the details on nodeSelect event and display on Right Side 
        document.querySelector('.textArea').textContent = data[0].navigateUrl; 
Please check the sample and get back to us, if you require any further assistance on this. 
Ashokkumar B. 

Live Chat Icon For mobile
Up arrow icon