Skip to content

Instantly share code, notes, and snippets.

@revolunet
Created August 22, 2011 12:14
Show Gist options
  • Star 17 You must be signed in to star a gist
  • Fork 4 You must be signed in to fork a gist
  • Save revolunet/1162236 to your computer and use it in GitHub Desktop.
Save revolunet/1162236 to your computer and use it in GitHub Desktop.
ExtJs debug : capture all events
// 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);
}
);
@AEKirin
Copy link

AEKirin commented Mar 3, 2013

Where exactly do you place this code? In the controller? the app.js? thanks

@fafk
Copy link

fafk commented Jan 31, 2014

The browser console window :)

@codinguncut
Copy link

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