[CLOSED] Menu not close and remain highlighted after clicked

  1. #1

    [CLOSED] Menu not close and remain highlighted after clicked

    Hi,

    I create the menu using below code.
    But when I clicked the menu item, the menu is not automatically close and the item is remain highlighted (please see attach).
    Would you please advise?

    Thanks

    <ext:Button ID="btnPMenu_Menu" runat="server" >                                            
        <Menu>
            <ext:Menu ID="PriorityMenu" runat="server" ShowSeparator="false">
                <Items>
                    <ext:ComponentMenuItem ID="ComponentMenuItem_PriorityMenu" runat="server" Shift="false">
                    <Component>
                        <ext:Container ID="Container_PriorityMenu" runat="server" Width="600" Height="200" Layout="HBox">
                        <Items>
                            <ext:MenuPanel ID="MenuPanel_PMenuAbnormal" runat="server" Flex="1" Title="ABNORMAL" Margins="0 5 0 0" Cls="white-menu">
                                <Menu ID="Menu_PMenuAbnormal" runat="server" ShowSeparator="false">
                                <Items>
                                    <ext:MenuItem ID="MenuItem7" runat="server" Text="GENERAL LAB" />
                                    <ext:MenuItem ID="MenuItem8" runat="server" Text="RADIOLOGY" />                                                                                        
                                </Items>
                                </Menu>
                            </ext:MenuPanel>                                                                            
                            <ext:MenuPanel ID="MenuPanel_PMenuNormal" runat="server" Flex="1" Title="NORMAL" Margins="0 5 0 0" Cls="white-menu">
                                <Menu ID="Menu_PMenuNormal" runat="server" ShowSeparator="false">
                                <Items>
                                    <ext:MenuItem ID="MenuItem10" runat="server" Text="GENERAL LAB" />                                                                                                                                                                     
                                </Items>
                                </Menu>
                            </ext:MenuPanel>                                                                                                                                                                                                                                                                             
                        </Items>
                        </ext:Container>
                    </Component>
                    </ext:ComponentMenuItem>
                </Items>
            </ext:Menu>
        </Menu>
    </ext:Button>
    Attached Thumbnails Click image for larger version. 

Name:	3.JPG 
Views:	93 
Size:	13.3 KB 
ID:	3257  
    Last edited by Daniil; Sep 29, 2011 at 8:04 AM. Reason: [CLOSED]
  2. #2
    Hi,

    Please set up the following ItemClick listener for the MenuPanel's menus.
    <ext:MenuPanel ...>
        <Menu ...>
            <Listeners>
                <ItemClick Handler="btnPMenu_Menu.hideMenu();" />
            </Listeners>
        </Menu>
    </ext:MenuPanel>
  3. #3
    Hi Daniil,

    Thanks.. The menu is close now, but the highlighted items are still there.
    How to remove the highlight from code behind? I am using listener to call the direct method
  4. #4
    Please set SaveSelection="false" for the MenuPanels.
  5. #5
    Hi Daniil,

    I have already set SaveSelection="false" for the MenuPanels, but the highlights are still there.
    If I remove the listener, the highlight is gone after I click the items. But if I put the listener back, the highlights are still there after I click the items.

    Thanks

    <ext:Button ID="btnPMenu_Menu" runat="server" >                                            
    <Menu>
        <ext:Menu ID="PriorityMenu" runat="server" ShowSeparator="false">
            <Items>
                <ext:ComponentMenuItem ID="ComponentMenuItem_PriorityMenu" runat="server" Shift="false">
                    <Component>
                        <ext:Container ID="Container_PriorityMenu" runat="server" Width="600" Height="200" Layout="HBox">
                            <Items>
                                <ext:MenuPanel ID="MenuPanel_PMenuAbnormal" runat="server" Flex="1" Title="ABNORMAL" Margins="0 5 0 0" Cls="white-menu" SaveSelection="false">
                                    <Menu ID="Menu_PMenuAbnormal" runat="server" ShowSeparator="false">
                                        <Items>
                                            <ext:MenuItem ID="MenuItem7" runat="server" Text="GENERAL LAB">
                                                <Listeners>
    												<Click Handler="menuclick();" />
                                                </Listeners>
                                            </ext:MenuItem>
                                            <ext:MenuItem ID="MenuItem8" runat="server" Text="RADIOLOGY">
                                                <Listeners>
    												<Click Handler="menuclick();" />
                                                </Listeners>
                                            </ext:MenuItem>
                                        </Items>
                                    </Menu>
                                </ext:MenuPanel>                            
                                <ext:MenuPanel ID="MenuPanel_PMenuNormal" runat="server" Flex="1" Title="NORMAL" Margins="0 5 0 0" Cls="white-menu" SaveSelection="false">
                                    <Menu ID="Menu_PMenuNormal" runat="server" ShowSeparator="false">
                                        <Items>
                                            <ext:MenuItem ID="MenuItem10" runat="server" Text="GENERAL LAB">                     
                                                <Listeners>
    												<Click Handler="menuclick();" />
                                                </Listeners>
                                            </ext:MenuItem>
                                        </Items>
                                    </Menu>
                                </ext:MenuPanel>      
                            </Items>
                        </ext:Container>
                    </Component>
                </ext:ComponentMenuItem>
            </Items>
        </ext:Menu>
    </Menu>
    </ext:Button>
  6. #6
    Please try to set up Delay="100" for the listeners:
    <Click Handler="menuclick();" Delay="100" />
  7. #7
    Hi Daniil,

    The highlights are still there...
  8. #8
    Ok, then I can suggest the following ItemClick listener of menus.
    <script type="text/javascript">
        var menuclick = function () {
            var menuPanel = Ext.getCmp(this.el.findParent(".x-panel").id);
            menuPanel.clearSelection();    
            btnPMenu_Menu.hideMenu();
        };
    </script>
    
    <ItemClick Fn="menuclick" />
  9. #9
    Hi Daniil,

    The highlight is gone now. Thanks..

Similar Threads

  1. Replies: 2
    Last Post: May 28, 2012, 1:54 PM
  2. Replies: 0
    Last Post: Mar 19, 2012, 7:26 AM
  3. Replies: 12
    Last Post: Dec 22, 2011, 10:33 AM
  4. Auto-close toolbar menu onmouseout event
    By sky73rx3 in forum 1.x Help
    Replies: 0
    Last Post: Dec 19, 2011, 2:55 AM
  5. [CLOSED] menu not automatically close if click the iframe
    By nhg_itd in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Nov 10, 2011, 5:57 AM

Posting Permissions