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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

What data is available in the "args" of a treeview event?

Thread ID:





118222 Feb 12,2015 11:53 AM UTC Feb 13,2015 09:08 AM UTC ASP.NET MVC 1
Tags: TreeView
Neil Partington
Asked On February 12, 2015 11:53 AM UTC


I am building a Treeview and have a handler for the "NodeSelect" event. i.e. @Html.EJ().TreeView("treeView").TreeViewFields(...).ClientSideEvents(s => s.NodeSelect("OnNodeClick"))

In the Javascript that handles the event - function OnNodeClick(args) { ... } - we get passed the "args" object.

I know that "args.value" gives me the nodes text value, but how can i get the "ID" or "ParentID" from the args object? 

Thanks in advance.

Sasikala Nagarajan [Syncfusion]
Replied On February 13, 2015 09:08 AM UTC

Hi Neil,

Thanks for using Syncfusion products,

We have analyzed your requirement (need Parent id, text, id as arguments in node select event).Currently in ‘nodeSelect’ event arguments we can get selected node’s value only. We have already logged this requirement as bug and a support incident has been created under your account to track the status of this requirement.


For your convenience we have prepared the workaround solution to achieve your requirement.

In node select event we can get the current element as arguments. We can use this current element and get the required fields (Pid, id, text) using jQuery traversing.

Please find the below code snippet



function OnNodeClick(args)


        var Pid =args.currentElement.parents("li").attr("id");

        var id=args.currentElement.attr("id");

        var text=args.currentElement[0].textContent;

        alert("Parent id :" +Pid +" id :"+id+" text :"+text);


Please use above code in your project to achieve your requirement until we fix the reported issue.


Sasikala Nagarajan


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon