Skip to content

Instantly share code, notes, and snippets.

@revolunet
Created August 22, 2011 12:14
Show Gist options
  • 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);
}
);
@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