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

item.open not working

1 Answer 56 Views
Menu
This is a migrated thread and some comments may be shown as answers.
Sean
Top achievements
Rank 2
Sean asked on 06 Feb 2009, 03:56 PM
I'm using the latest asp radcontrols and trying to open a menu item up by default when the page displays.  I'm using the following js sample code from this site:

 

function openMenu() {

 

  var menu = $find("<%= MainMenu.ClientID %>");

 

  var item = menu.findItemByText("Invoices");

  item.open();

 

}

but VS2008 stops at item.open() and says the method doesn't exist.  I can inspect item, see that it's not null, it has a value and see a method list which includes stuff like focus, expand, show, etc but it's right, there's no open method in the list.

Any idea what's wrong?  I found a few different samples on the site but they all call item.open.

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 09 Feb 2009, 07:18 AM
Hello Sean,

I tried the code in my end and its working fine for me. I am not sure about the issue at your side. I called the openMenu() function from client side pageLoad(). Try calling the openMenu() from pageLoad and see whether its working fine for you.

JavaScript:
<script type="text/javascript"
function pageLoad() 
    openMenu(); 
 
function openMenu() 
    var menu = $find("<%= MainMenu.ClientID %>"); 
    var item = menu.findItemByText("Invoices"); 
    item.open(); 
</script> 

Thanks,
Shinu.
Tags
Menu
Asked by
Sean
Top achievements
Rank 2
Answers by
Shinu
Top achievements
Rank 2
Share this question
or