Get node index on click.

2 posts, 0 answers
  1. Freddy
    Freddy avatar
    25 posts
    Member since:
    Feb 2013

    Posted 08 Aug 2013 Link to this post

    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
  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 09 Aug 2013 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top