JavaScript
Run Code
Open in Fiddle
Ext.define('MyController', { extend: 'Ext.app.ViewController', alias: 'controller.mycontroller', onOurLogin: function(btn, e, eOpts) { console.log('mycontroller tap') } }) Ext.define('ButtonController', { extend: 'Ext.app.ViewController', alias: 'controller.buttoncontroller', onOurLogin: function(btn, e, eOpts) { console.log('mybutton tap') } }) Ext.define('MyButton', { extend: 'Ext.Button', xtype: 'mybutton', ui: "soft-red", iconAlign: "right", text: "Login2", margin: '0 10px 0 0', controller: 'buttoncontroller', listeners: { tap: "onOurLogin" } }) Ext.application({ name : 'Fiddle', launch : function() { Ext.Viewport.add( Ext.Panel({ fullscreen: true, controller: 'mycontroller', items: [{ xtype: "button", ui: "soft-red", iconAlign: "right", text: "button controlled by main", margin: '0 10px 0 0', controller: 'buttoncontroller', listeners: { tap: "onOurLogin" } }, { xtype: 'mybutton', text: 'button controlled by button' }, { xtype: 'mybutton', text: 'button controlled by both', listeners: { tap: "onOurLogin" } }] }) ) } });