RadFormDecorator causing menu item to collapse

3 posts, 0 answers
  1. Travis Martin
    Travis Martin avatar
    6 posts
    Member since:
    Mar 2010

    Posted 29 Jul 2010 Link to this post

    I am implementing a Mega Drop-Down menu and am having a couple of troubles.  I have a dropdown list and also a textbox implementing jQuery's autocomplete.  When either the dropdown list items or the autocomplete items take focus, the menuitem collapses....this leaves me with the dropdown list items expanded or the autocomplete items expanded....but the menu closed.  How do I keep the menu item open when the focus moves to the ddl items or the autocomplete items?

    Thanks!
  2. Travis Martin
    Travis Martin avatar
    6 posts
    Member since:
    Mar 2010

    Posted 02 Aug 2010 Link to this post

    Doesn't seem to have anything to do with the RadFormDecorator, but is most easily reproduced with decorated controls.
  3. Travis Martin
    Travis Martin avatar
    6 posts
    Member since:
    Mar 2010

    Posted 03 Aug 2010 Link to this post

    Ok, so I figured out a work around for this...

    In the OnClientItemClosing event for the menu I set it to OnClientItemClosing="ItemClosing"

    Here is my itemClosing JS

    function ItemClosing(menu, args) {
                
                var itemName = args.get_item().get_text();
                if (itemName == "Settings") {
                    args.set_cancel(true);
                }
            }

    I add an image button in the menu item that will act as my close button

    <div style="float:right;"><asp:ImageButton ID="btnCloseMenuImg" runat="server" OnClientClick="PSearchClose" ImageUrl="~/images/closemenuitem.gif" /></div>


     and add the following JS

    function PSearchClose() {
                var menu = $find("<%= RadMenu1.ClientID %>");
                var itemToOpen = menu.get_items().getItem(0);
                itemToOpen.close();
            }

    This allows me to keep that menuitem open while the user potentially mouses-out of the item.

Back to Top