Unable to get the details of m array when clicked on checkbox in treeView

I have used checkedNodes and got the id of the objects but I am unable to get the the name and other values present in array.
I have used your example.
This is the link from where i copied the code -https://ej2.syncfusion.com/angular/documentation/treeview/check-box/

1 Reply 1 reply marked as answer

SP Sowmiya Padmanaban Syncfusion Team November 9, 2020 07:41 AM UTC

Hi Balwant Birajdar,  
 
Greetings from Syncfusion support. 
 
We have checked your requirement with TreeView component. You can  achieve your requirement by passing the id value as parameter for getTreeData method of TreeView component. This method returns the all the fields data of the corresponding tree node. 
 
Please, refer the below code snippet to fullfil your requirement. 
 
 public nodeChecked(args): void { 
    console.log(args.data); 
    //returns the corresponding data of passed node id. 
    console.log(this.tree.getTreeData(this.tree.checkedNodes[0])); 
  } 
 
Please, refer the below sample link with above solution. 
 
 
Please, refer to the below links to know more about the TreeView component. 
 
 
 
 
Please let us know, if you need any further assistance. 
 
Regards,  
Sowmiya.P 


Marked as answer
Loader.
Up arrow icon