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

Can a link in a treeview node respond to its own event handler?


I have a TreeView using templates.  I am wondering if it's possible to have a link inside of a node that responds to it's own click event and not the nodeClick event of the tree.  For example here is a template:

<script id="treeTemplate" type="text/x-jsrender">
        <td><a onclick="{{>SomeURL}}"><img src="{{>SomeIconPath}}" /></a></td>

So, clicking the <img/> tag would fire the onClick event of the anchor tag, and not the nodeClick event of the tree.



1 Reply

SN Sasikala Nagarajan Syncfusion Team July 22, 2015 03:59 AM UTC

Hi Randy,
Thanks for using Syncfusion products,

We have analyzed your query. We can achieve your requirement using our link Attribute feild property of Treeview. This property is used to set the hyper link of node. We have prepared the simple sample based on this. Please get the sample from below location


If you didn’t need treeview node click event in this case, you can achieve this by cancelling the particular event. This can be done by setting cancel argument value to true(cancel is one of the argument of node click event).Please refer the below code snippet


fields: {

dataSource: treeData,

id: "id", parentId: "pid", text: "name", hasChild: "hasChild", linkAttribute: "linkAttribute"


template: "#treeTemplate", nodeClick: "nodeClick"


function nodeClick(args) {

args.cancel = false;


Please check with the provided sample and let us know if you have further queries,
Sasikala Nagarajan

Live Chat Icon For mobile
Up arrow icon