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

jquery for click

1 Answer 59 Views
OrgChart
This is a migrated thread and some comments may be shown as answers.
Jon
Top achievements
Rank 1
Jon asked on 05 Jul 2012, 12:09 PM
Hi,

How would I go about using jquery to add a click event to an orgchart?  I want to be able to click on a person then display that person in a popup window so would need the ID.

Am I better adding a click event from teh code behind or is it easy to do with jquery - examples much appreciated!

Regards,

Jon

1 Answer, 1 is accepted

Sort by
0
Plamen
Telerik team
answered on 09 Jul 2012, 12:34 PM
Hi Jon,

 
Here is one way to achieve such functionality by using jQuery and the _extractNodeFromDomElement function of RadOrgChart:

function pageLoad() {
 
              $telerik.$(".rocGroup").click(function myfunction(e) {
                  var orgChart = $find("<%= RadOrgChart1.ClientID %>");
                  var hierarchicalIndex = orgChart._extractNodeFromDomElement(e.target)._getHierarchicalIndex();
                  alert(hierarchicalIndex);
              })
          }

Hope this will be helpful.

Regards,
Plamen Zdravkov
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
OrgChart
Asked by
Jon
Top achievements
Rank 1
Answers by
Plamen
Telerik team
Share this question
or