Results 1 to 4 of 4

Thread: Horizontal Menu in ExtJS 4

  1. #1

    Default Answered: Horizontal Menu in ExtJS 4

    How can I create an Horizontal Menu like below in ExtJS 4 ?

    dev.sencha.com/playpen/ext-core-latest/examples/menu

  2. Here's a trivial example to get you started:

    Code:
    Ext.create('Ext.window.Window', {
      height: 250,
      width: 350, 
      title: 'Menu Test',
      dockedItems: [{
        xtype: 'toolbar',
        dock: 'top',
        items: [{
          xtype: 'splitbutton',
          text: 'File',
          menu: {
            items: [{
              text: 'New...'
            },{
              text: 'Open...'
            }]
          }
        },{
          xtype: 'splitbutton',
          text: 'Edit',
          menu: {
            items: [{
              text: 'Copy'
            },{
              text: 'Paste'
            }]
          }
        }]    
      }]
    }).show()

  3. #2
    Sencha Premium User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,379
    Answers
    3997

    Default

    Use a button with menus and then style it all the way you want.
    Mitchell Simoens @LikelyMitch

    Check out my GitHub:
    https://github.com/mitchellsimoens

    Posts are my own, not any current, past or future employer's.

  4. #3
    Sencha User friend's Avatar
    Join Date
    Apr 2011
    Posts
    895
    Answers
    106

    Default

    Here's a trivial example to get you started:

    Code:
    Ext.create('Ext.window.Window', {
      height: 250,
      width: 350, 
      title: 'Menu Test',
      dockedItems: [{
        xtype: 'toolbar',
        dock: 'top',
        items: [{
          xtype: 'splitbutton',
          text: 'File',
          menu: {
            items: [{
              text: 'New...'
            },{
              text: 'Open...'
            }]
          }
        },{
          xtype: 'splitbutton',
          text: 'Edit',
          menu: {
            items: [{
              text: 'Copy'
            },{
              text: 'Paste'
            }]
          }
        }]    
      }]
    }).show()

  5. #4
    Sencha User
    Join Date
    Sep 2010
    Posts
    459
    Answers
    5

    Default

    When I make a horizontal menu with split buttons, I am not able to right-click-open-in-a-new-window.

    Something I do from the main menu at our site all day long.

    So in my case the first answer is better:
    http://dev.sencha.com/playpen/ext-co...xamples/menu/#

    But I am confused about where it came from.
    Is it very old or very new?

    Maybe the geniuses know how to style split buttons so that they support the browser right-click menu (recognized as a link that can be opened in a new window or tab)?

    Which is the path of the future here?


    The example uses Ext.extend, so it is old.
    The trick I needed was to use html:'<a href...>' instead of text.

Posting Permissions

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