1

On menu items you are able to optionally add either a handler to handle press or mouseclick events or specify and href configuration so that when the menu is simply a link.

  {
     text: 'Example Ext Menu Item',
     iconCls: 'x-fa fa-cog',
     href: 'https://www.google.com'
  }

For the Ext.Button (Modern) how can you have the button act as a link while still supporting the other features of a button (icons, on hover etc).

For example I would like to be able to "right click" on any area of the button and "open in a new tab".

Tony J Watson
  • 629
  • 2
  • 9
  • 20
  • Have you tried search this? Because certain examples that work on classic will work on modern too. – NAmorim Nov 27 '17 at 10:45

1 Answers1

2

You can wrap the button in a custom element by overriding like this:

Ext.define('MyApp.components.MyButton', {
    extend: 'Ext.Button',
    xtype: 'mybutton',

    element: {
        reference: 'element',
        tag: 'a',
        href: 'http://www.foo.bar'     
    }
});
Tony J Watson
  • 629
  • 2
  • 9
  • 20
Federico Baron
  • 967
  • 6
  • 15