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

ClickToOpen - menu.close()

3 Answers 73 Views
Menu
This is a migrated thread and some comments may be shown as answers.
rkoops
Top achievements
Rank 1
rkoops asked on 16 Dec 2008, 11:31 AM
I use a RadMenu and specify ClickToOpen="True".
This works as expected. The user has to click a menuitem in order to expand the menu. 

If the user clicks a child menuitem, the following javascript function is called:

 

function closeNow() {

 

 

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

 

menu.close();

}


Still this works as expected, i.e., the menu closes.

However if the user now hovers over the menu, the menu expands, i.e., the menu expands without a mouse click. This is unwanted.

3 Answers, 1 is accepted

Sort by
0
Accepted
Shinu
Top achievements
Rank 2
answered on 16 Dec 2008, 12:25 PM
Hi,

Try adding the client side function to OnClientMouseOver in order to cancel expanding RadMenuItem when mouse hovers. Please check out the link to online documentation which descibe expanding items only by clicking on it.
Expand root menu item on click only

Thanks,
Shinu.
0
Accepted
Yana
Telerik team
answered on 18 Dec 2008, 08:29 AM
Hello,

Please try to call menu.set_clicked(false) before menu.close() in your closeNow() function.

Best regards,
Yana
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
rkoops
Top achievements
Rank 1
answered on 18 Dec 2008, 08:57 AM
Shinu and Yana,

Thanks for your help, function menu.set_clicked(false) does what I was looking for.

Roland
Tags
Menu
Asked by
rkoops
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Yana
Telerik team
rkoops
Top achievements
Rank 1
Share this question
or