Created
August 22, 2011 12:14
-
-
Save revolunet/1162236 to your computer and use it in GitHub Desktop.
ExtJs debug : capture all events
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// to capture ALL events use: | |
Ext.util.Observable.prototype.fireEvent = | |
Ext.util.Observable.prototype.fireEvent.createInterceptor(function() { | |
console.log(this.name); | |
console.log(arguments); | |
return true; | |
}); | |
// to capture events for a particular component: | |
Ext.util.Observable.capture( | |
Ext.getCmp('my-comp'), | |
function(e) { | |
console.info(e); | |
} | |
); |
The browser console window :)
createInterceptor seems to have been removed.
Please compare here for a newer version:
http://www.sencha.com/forum/showthread.php?124506-createInterceptor-missing
The following works for me in Ext.js 4.2.2:
Ext.util.Observable.prototype.fireEvent =
Ext.Function.createInterceptor(Ext.util.Observable.prototype.fireEvent, function() {
console.log(this.name);
console.log(arguments);
return true;
});
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Where exactly do you place this code? In the controller? the app.js? thanks