Skip to content

Instantly share code, notes, and snippets.

@rhalff
Forked from inakiabt/extjs-capture.js
Created May 27, 2013 13:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rhalff/5657091 to your computer and use it in GitHub Desktop.
Save rhalff/5657091 to your computer and use it in GitHub Desktop.
// 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);
}
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment