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

Calling external javascript on node click

1 Answer 39 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Richard Priddy
Top achievements
Rank 1
Richard Priddy asked on 20 Nov 2008, 11:42 AM

Hello,

I am binding a datatable to my rad tree view and depending on the node's level, get it to call a javascript function when it is click, along with doing the normal post back call.

Many thanks for help provided.

Richard

1 Answer, 1 is accepted

Sort by
0
Richard Priddy
Top achievements
Rank 1
answered on 20 Nov 2008, 11:45 AM

Hello again,

Sorry for waisting anyones time, but I have just figured it out, For future referance, or anyone else needing a solution to this:

  if (e.Node.Level == 1)
e.Node.Attributes.Add("OnClick", "switchTo('account')");
else if (e.Node.Level == 2)
e.Node.Attributes.Add("OnClick", "switchTo('contact')");

Tags
TreeView
Asked by
Richard Priddy
Top achievements
Rank 1
Answers by
Richard Priddy
Top achievements
Rank 1
Share this question
or