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

RadFormDecorator causing menu item to collapse

2 Answers 27 Views
Menu
This is a migrated thread and some comments may be shown as answers.
Travis Martin
Top achievements
Rank 1
Travis Martin asked on 30 Jul 2010, 12:20 AM
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 Answers, 1 is accepted

Sort by
0
Travis Martin
Top achievements
Rank 1
answered on 02 Aug 2010, 06:30 PM
Doesn't seem to have anything to do with the RadFormDecorator, but is most easily reproduced with decorated controls.
0
Travis Martin
Top achievements
Rank 1
answered on 03 Aug 2010, 06:54 PM
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.

Tags
Menu
Asked by
Travis Martin
Top achievements
Rank 1
Answers by
Travis Martin
Top achievements
Rank 1
Share this question
or