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

RadMenu get_item method

4 Answers 120 Views
Menu
This is a migrated thread and some comments may be shown as answers.
Andrew Currie
Top achievements
Rank 1
Andrew Currie asked on 03 Dec 2009, 02:15 PM
Hi,

I am getting a javascript error "...has no method 'get_item'" in the following code:

          function InitDocumentsMenu(numberOfItems) {
               var menu = $find("<%= mnuDocuments.ClientID %>");
               var topMenuItem = menu.get_items().get_item(0);
}

I have a menu item with child menus but this javascript is not working.  The get_count() returns fine.  I don't know what can be the problem??

Telerik Q2 2009 - 2009.2.826.35

Thanks

4 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 03 Dec 2009, 02:49 PM
Hi Andrew,

Give a try with following code and see whether it works fine.

<script type="text/javascript">
    function access() {
        var menu = $find("<%= RadMenu2.ClientID %>");
        var topMenuItem = menu.get_items().getItem(0);
    }
</script>

-Shinu.
0
Andrew Currie
Top achievements
Rank 1
answered on 03 Dec 2009, 02:53 PM
Thanks - it always helps to read the documentation properly!  What a wally I am!  Thanks again
0
Mark Galbreath
Top achievements
Rank 2
answered on 05 Feb 2010, 04:41 PM
not your fault; the method name violates Telerik's own naming convention.

Cheers!
Mark
0
bilal
Top achievements
Rank 2
answered on 24 Sep 2010, 03:40 PM
hi Shuni

i'm using this function:

function menuTopNavigation() {
        var menu = $find("<%= menuTopNavigation.ClientID %>");
        var itemToOpen = menu.get_items().getItem(0);
        itemToOpen.open();
    }
but this always give me the first node in the menu, but i need this to give me the node i clicked on it to keep it open when i clicked on any node keep it open.

please help me in this.

Bilal 
Tags
Menu
Asked by
Andrew Currie
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Andrew Currie
Top achievements
Rank 1
Mark Galbreath
Top achievements
Rank 2
bilal
Top achievements
Rank 2
Share this question
or