This is a migrated thread and some comments may be shown as answers.

Get node index on click.

1 Answer 37 Views
OrgChart
This is a migrated thread and some comments may be shown as answers.
Freddy
Top achievements
Rank 1
Freddy asked on 08 Aug 2013, 07:23 PM
Hi

I cannot find a click event handler for the radorgchart node.but i have an urgent requirement, on clicking a node I want to fetch the index and store it in a hidden field. Any work around?

Thanks
Freddy

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 1
answered on 09 Aug 2013, 08:32 AM
Hi Freddy,

RadOrgChart does not have a node click handler but you can access each node based on its CSS class and add a click event with the help of jQuery. Please check the following code which works fine at my end.

JavaScript:
<script type="text/javascript">
    $telerik.$(".rocItem").click(function (e) {
        var orgChart = $find("<%= RadOrgChart1.ClientID %>");
        var index = orgChart._extractGroupItemFromDomElement(e.target).get_index();
        alert("Clicked " + index);
    })
</script>

Thanks,
Princy.
Tags
OrgChart
Asked by
Freddy
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 1
Share this question
or