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

Find selected node in client script..

3 Answers 69 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
piyush
Top achievements
Rank 1
piyush asked on 20 Jul 2009, 01:44 PM
I am using the following javascript function

function

 

OnEndRequest(sender,args) {

 

alert();

 

var treeviewInstance = $find("<%= treeFramework.ClientID %>");

 

alert(treeviewInstance);

 

var selectedNode = treeviewInstance.getSelectedNode();

 

 

if (selectedNode != null)

 

{

selectedNode.ScrollIntoView();

}

}

It gives an errror that getSelectedNode();method is not supported..

I tried using get_SelectedNode() but no help.


Actually i want to scroll to selected node on ajax request..

3 Answers, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 20 Jul 2009, 03:27 PM
Hi piyush,

The correct syntax is

var node = treeView.get_selectedNode();
node.scrollIntoView();

You can check the following client-side API reference help topics for additional info:
http://www.telerik.com/help/aspnet-ajax/tree_clientradtreeviewobject.html
http://www.telerik.com/help/aspnet-ajax/tree_clientradtreenode.html

Regards,
Albert
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
piyush
Top achievements
Rank 1
answered on 23 Jul 2009, 05:37 PM
treeView.get_selectedNode()

When I am using this method to get selected node from treeview control in javascript I am getting javascript saying this method is not supported.
0
Yana
Telerik team
answered on 24 Jul 2009, 05:11 AM
Hello piyush,

It's supposed to work, please check the attached simple page.

Regards,
Yana
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
TreeView
Asked by
piyush
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
piyush
Top achievements
Rank 1
Yana
Telerik team
Share this question
or