Results 1 to 2 of 2

Thread: Menu with a child menu?

  1. #1
    Sencha User kryo's Avatar
    Join Date
    Jan 2010
    Location
    Costa Rica
    Posts
    34

    Question Menu with a child menu?

    Hi @ll,

    How can I make the following work? It seems when the child menu item is clicked, the parent menu disappears, and the child menu [item 1, item 2, item 3] still displays. HideOnClick option doesn't appear to affect the child menu. I'm using a semi-outdated version of Extjs (3.1.1) could that be it?

    Sorry if this was answered before. Seems simple enough, but couldn't describe the problem in a way that Google could find something useful.

    HTML Code:
    <html>
    <head>
    <script type="text/javascript">
    Ext.onReady(function(){
      new Ext.Panel({
        renderTo: 'f00',
        height: 200,
        width: 400,
        tbar: {
          items: [{
            text: 'Form With Menu', menu: {
              showSeperator: false,
              items: {
                xtype: 'panel',
                width: 300,
                height: 200,
                tbar: { items: [ { text: "Form Menu", menu: { items: [
                  { text:"Item 1" },
                  { text:"Item 2" },
                  { text:"Item 3" },
                ] } }] }
              }
            }
          }]
        }
      });
    });
    </script>
    </head>
    <body>
    <div id="f00"></div>
    </body>
    </html>
    Last edited by kryo; 13 Oct 2010 at 5:07 PM. Reason: Got rid of tabs.. was hard to read before.
    --
    Hans Doller
    [email protected]
    Senior Web Developer & Consultant

    Contributed Plugins: Ext.date.RangeField, Ext.money.Exchange, Ext.locale.Format, Ext.ux.Bootstrap

  2. #2
    Sencha User kryo's Avatar
    Join Date
    Jan 2010
    Location
    Costa Rica
    Posts
    34

    Default

    Thanks to the evant_ and snowsnakes: Solution is as follows:

    Code:
    Ext.onReady(function(){
    
    var d = new Date();
    
        new Ext.Panel({
            renderTo: document.body,
            height: 200,
            width: 400,
            tbar: {
                items: [{
                    text: 'Form With Menu',
                    menu: {
                        allowOtherMenus: true,
                        showSeperator: false,
                        items: {
                            xtype: 'panel',
                            width: 300,
                            height: 200,
                            tbar: {
                                items: [{
                                    text: "Form Menu",
                                    menu: {
                                        allowOtherMenus: true,
                                        items: [{
                                            text: "Item 1"
                                        }, {
                                            text: "Item 2"
                                        }, {
                                            text: "Item 3"
                                        }, ]
                                    }
                                }]
                            }
                        }
                    }
                }]
            }
        });
    });

    Thanks again!
    --
    Hans Doller
    [email protected]
    Senior Web Developer & Consultant

    Contributed Plugins: Ext.date.RangeField, Ext.money.Exchange, Ext.locale.Format, Ext.ux.Bootstrap

Similar Threads

  1. Replies: 1
    Last Post: 26 Feb 2010, 2:06 PM
  2. [OPEN] [FIXED] Window that opens child Window - Menu displayed behind child
    By jonjanisch in forum Ext GWT: Bugs (2.x)
    Replies: 1
    Last Post: 10 Sep 2009, 8:58 AM
  3. Mouse click does not work on menu items(when menu is rendered as context menu)
    By anilcs0405 in forum Ext 3.x: Help & Discussion
    Replies: 4
    Last Post: 3 Aug 2009, 5:55 AM
  4. Ext.menu.menu - enable submenu though parent menu being disabled?
    By ikk0 in forum Ext 2.x: Help & Discussion
    Replies: 8
    Last Post: 16 Jul 2008, 12:42 PM
  5. Replies: 3
    Last Post: 8 Apr 2008, 11:52 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •