Hello, first of all sorry for my english poor. ;-(
In my application, before any button click event, I would to fires an "validationFunction" for each button action (handler).
To do this, i should to override Ext.Button (to get this performs for all my application buttons) and I tried this:
Ext.override(Ext.Button, {
initComponent:function() {
// call parent init component
Ext.Button.superclass.initComponent.apply(this, arguments);
// add custom events
this.addEvents('criticalAction',this.criticalAction);
//Add listener
Ext.Button.superclass.mon(this.el, 'criticalAction', this.criticalAction(), this,{buffer: 50});
//change click event to fires criticalAction
this.clickEvent = 'criticalAction';
log(Ext.Button);
},
criticalAction : function (){
alert('es una accion critica');
Ext.Button.onClick(this);
}
});
but this not work, because AddListener throws me.events = undefined
I found preventEvent() on Ext.Button.onclick but I dont know how edit it.