PDA

View Full Version : Extended component events



Cp_Barbossa
25 Mar 2014, 8:41 AM
Hey.

How to prevent parent event auto calling in extended components?



Ext.define('CustomPanel', {
extend: 'Ext.panel.Panel',
alias: 'widget.custompanel',
listeners: {
'someevent': function(){
console.log('hey...')
}
}
});
Ext.define('CustomPanel2', {
extend: 'CustomPanel',
alias: 'widget.custompanel2',
listeners: {
'someevent': function(){
console.log('bye...')
}
}
});


Now, if 'custompanel2' 'someevent' is fired, the result is: hey...bye...

What i want is, the result to be - bye... How's that?

Thanks

Cp_Barbossa
27 Mar 2014, 1:31 AM
:s

greg.barry
31 Mar 2014, 1:29 PM
I'm not sure you've fully explained your scenario. I turned your example into a Fiddle and it acts exactly as you say you desire.

https://fiddle.sencha.com/#fiddle/4le

Can you expound upon what you're doing or fork the fiddle to make it more accurate to your situation?

Thanks!
Greg