Get_Selected: Object doesn't support this property or method

3 posts, 1 answers
  1. Paul Mc
    Paul Mc avatar
    32 posts
    Member since:
    Sep 2007

    Posted 10 Jul 2009 Link to this post

    Hi

    We have a radwindow with a rad toolbar across the top and a rad treeview underneath.  In a seperate javascript file, I'm trying to find out which treeview node is currently selected when a button on the toolbar is clicked.  I have stored the Client ID of the treeview as an attribute of the menu and im using the Ajax $find method to locate the treeview object.  The treeview appears to be being found correctly but when i call the get_selected method im getting an object not supported error message.  Is there something obvious im misisng?

    Below is a cut down version of the code I have in my Javascript file:

    function ToolbarItemClicked(sender, eventArgs) {  
     
        var toolbar = eventArgs.get_item().get_toolBar();  
        var toolbarItem = eventArgs.get_item();  
     
        var ctrlID = toolbar.get_attributes().getAttribute("TreeViewID");  
     
        var treeview = $find(ctrlID);  
        var node = treeview.get_selected();  
     
    }

    For your information we using the Q2 2009 build.

    Thanks in advance.

    Paul
  2. Answer
    Atanas Korchev
    Admin
    Atanas Korchev avatar
    8462 posts

    Posted 10 Jul 2009 Link to this post

    Hello Paul Mc,

    RadTreeView does note expose such a method. I guess you need to obtain the selected node. To do this please use get_selectedNode():

    var node = treeview.get_selectedNode();

    Kind 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. Paul Mc
    Paul Mc avatar
    32 posts
    Member since:
    Sep 2007

    Posted 10 Jul 2009 Link to this post

    *Banging head on wall* How stupid do I feel now!

    Thank Albert, i was looking at the wrong place in the documentation...

    i.e.  node.get_selected rather than tree.get_selectednode()
Back to Top