The problem is pretty simple. If you have a listener property in your class, then once you create an instance of the class and add the listener property to that particular instance, it will gong override the list.define listener property. Similar:
var obj = { foo: { bar : 'Hello World' } }; obj = Ext.merge(obj, {
Will you get the bar property of foo ? No. Identical properties are overridden. Similar things happen for listeners.
Ext.define('ABC', { config : { listeners : { 'tap' : Ext.emptyFn } } }); var newPanel = Ext.create('ABC', { listeners : { 'activate' : Ext.emptyFn } });
The configuration object that you pass to Ext.create is combined with the Ext.define configuration Ext.define . Thus, its always best not to use the listener property in Ext.define .
Swar source share