ClickToOpen - menu.close()

4 posts, 2 answers
  1. rkoops
    rkoops avatar
    2 posts
    Member since:
    Jan 2007

    Posted 16 Dec 2008 Link to this post

    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.
  2. Answer
    Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 16 Dec 2008 Link to this post

    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.
  3. Answer
    Yana
    Admin
    Yana avatar
    5015 posts

    Posted 18 Dec 2008 Link to this post

    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.
  4. rkoops
    rkoops avatar
    2 posts
    Member since:
    Jan 2007

    Posted 18 Dec 2008 Link to this post

    Shinu and Yana,

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

    Roland
Back to Top