inakiabt
3/20/2012 - 10:42 PM

ExtJs debug : capture all events

ExtJs debug : capture all events

// to capture ALL events use:
Ext.util.Observable.prototype.fireEvent =  Ext.Function.createInterceptor(Ext.util.Observable.prototype.fireEvent, function(evt) {
		var a=arguments;
		console.log(this,' fired event ',evt,' with args ',Array.prototype.slice.call(a,1,a.length));
        return true;
});
 
// to capture events for a particular component:
Ext.util.Observable.capture(
    Ext.getCmp('my-comp'),
    function(e) {
        console.info(e);
    }
);