Move focus from Radmenu

4 posts, 0 answers
  1. Sean Severson
    Sean Severson avatar
    56 posts
    Member since:
    Aug 2009

    Posted 18 Nov 2011 Link to this post

    My page contains a RadMenu with ClickToOpen = true.  After that, hovering over the menu will expand to display the child menu items.  Upon selection of one of the child menu items I open a modal RadWindow via javascript.  I also use javascript to collapse the radmenu (shown below).

    The problem is that after the RadWindow is closed (no pastback occurs on the parent page), it is no longer necessary to click on the RadMenu to begin showing the menu items.  All the user needs to do is hover.  I have attempted to move the focus to another control on the page, but the RadMenu does not appear to lose focus.  I also tried using the blur() method in the code that collapses the menu, but that does not appear to work either.  How do I move the focus away from the menu so users must click on the menu to again open it?

    Here is the javascript function to collapse (with the call to Blur to try to move the focus away from the RadMenu). 

    function CollapseMenu() { 
        //close the menu 
        var menu = $find("<%= mnuActions.ClientID %>"); 
        var topMenuItem = menu.get_items().getItem(0); 
        topMenuItem.close(); 
        topMenuItem.Blur(); 
    }


    Thanks!

    Sean M. Severson
  2. Kate
    Admin
    Kate avatar
    1898 posts

    Posted 21 Nov 2011 Link to this post

    Hi Sean,

    You could try to use the approach recommended in this forum post. Let me know how it goes and if it helps you get the desired behavior. 

    Greetings,
    Kate
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Sean Severson
    Sean Severson avatar
    56 posts
    Member since:
    Aug 2009

    Posted 22 Nov 2011 Link to this post

    Kate,

    Unless I am missing something, the thread you suggested only addresses the closing of the RadMenu.  I am able to close the Radmenu just fine.  The problem I am experiencing is that once a menu item is selected, I need to somehow "reset" the RadMenu so that the user must click on the top level menu item in order to expand.  i would think that moving the focus from the Radmenu to another control would solve the problem, but I have not been able to make this happen.

    Sean M. Severson
  5. Kate
    Admin
    Kate avatar
    1898 posts

    Posted 25 Nov 2011 Link to this post

    Hi Sean,

    I understand that you need to reset the RadMenu but it seems that you have already tried the different approaches that I would have suggested. However, I could think of one more approach that seems to be suitable for your scenario. Here you can find a help article where the desired behavior is demonstrated.  

    All the best,
    Kate
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
Back to Top