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.
Unfortunately, activation email could not send to your email. Please try again.

OnClick Event

Thread ID:

Created:

Updated:

Platform:

Replies:

116013 Mar 17,2014 06:15 AM Mar 19,2014 12:35 AM ASP.NET MVC (Classic) 3
loading
Tags: TreeView
John Ashton
Asked On March 17, 2014 06:15 AM

Hi,

On click event to show ID only shows the tree id instead of the node clicked ID?

Please help,

Thanks,

John
    function CA_OnNodeClick(args) {
        alert(args._id);
    }
@(Html.Syncfusion().TreeView("CA_treeView", "CA_treeViewContents").ClientSideOnNodeClick("CA_OnNodeClick"))



Gurunathan A [Syncfusion]
Replied On March 17, 2014 07:41 AM

Hi John,

Thanks for contacting Syncfusion support.

 

We have analysed that provided code: in that, you have tried to get the id of clicked node from first argument in clientsideonnodeclick event. But it is available in second argument of this event. Please refer the below code snippet.

<code>

[View]

 

@(Html.Syncfusion().TreeView("myTreeView", "treeView").Height(150).Width(200).ClientSideOnNodeClick("onclicktreenode"))

 

    <script type="text/javascript">

    function onclicktreenode(sender, args){

        alert(args._id);

    }

    </script>

 

</code>

Note : First argument has Treeview control id and their properties and second one has clicked node id and its properties.

 

Please let us know if you have further queries on this.

 

Thanks,

Gurunathan


John Ashton
Replied On March 17, 2014 09:20 AM

Cheers Gurunathan works great.

Gurunathan A [Syncfusion]
Replied On March 19, 2014 12:35 AM

Hi John,

Thanks for the update.

 

Please let us know if you required further assistance on this.

 

Thanks,

Gurunathan


CONFIRMATION

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.

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.

;