Child Node Icon onClick

How to add ICON to Child Node of tree view at right side of text? 

How to add onClick event to Child Node Icon only ?( Not on entire row)

Requirement:

1)Add icon to right side of text in tree child node
2) add Onclick event to Icon of child node only not on entire row
3) Capture icon onclick event , so that we can perfom add , delete, edit operation on Icon click.

1 Reply 1 reply marked as answer

KR Keerthana Rajendran Syncfusion Team March 23, 2021 09:25 AM UTC

Hi Sagar, 
 
Thanks for contacting Syncfusion support.  
 
We checked your requirement to add icon to right side of TreeView node text.  
 
Query 1: Add icon to right side of text in tree child node 
 
This requirement can be achieved by rendering required HTML element within template option of TreeView.  
 
Refer to the following demo for rendering template within TreeView.  
 
 
Query 2: add Onclick event to Icon of child node only not on entire row. 
 
In TreeView, nodeClick event will be triggered on each node click. You can get the exact target as shown below through “args.event.target” when the icon of child node is clicked. 
 
 
 
Based on this target, you can perform required operations during icon click alone as per your requirement.  
 
Refer to the following links for more details on EJ1 TreeView.  
 
 
 
Please let us know if you need further assistance.  
 
Regards, 
Keerthana.  


Marked as answer
Loader.
Up arrow icon