Find selected node in client script..

4 posts, 0 answers
  1. piyush
    piyush avatar
    3 posts
    Member since:
    Apr 2009

    Posted 20 Jul 2009 Link to this post

    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..

  2. Atanas Korchev
    Admin
    Atanas Korchev avatar
    8462 posts

    Posted 20 Jul 2009 Link to this post

    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.
  3. piyush
    piyush avatar
    3 posts
    Member since:
    Apr 2009

    Posted 23 Jul 2009 Link to this post

    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.
  4. Yana
    Admin
    Yana avatar
    4993 posts

    Posted 24 Jul 2009 Link to this post

    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.
Back to Top