-
21 Feb 2012 1:40 PM #1
Answered: What is equivalent of ST1 Observable.capture method?
Answered: What is equivalent of ST1 Observable.capture method?
What is the equivalent in ST2 of the ST1 Ext.util.Observable.capture call? I made use of this method quite a bit in debugging to see all events coming off an object and the timing of the calls. If possible I would like to continue using it.
-
Best Answer Posted by mitchellsimoens
There isn't one built in. All the capture function did was create an interceptor to the fireEvent function. So what you could do is override Ext.mixin.Obervable hook into the fireEvent and fireAction methods:
Code:Ext.define('Override.mixin.Observable', { override : 'Ext.mixin.Observable', fireEvent : function(eventName) { console.log(eventName); this.callOverridden(arguments); }, fireAction : function(eventName) { console.log(eventName); this.callOverridden(arguments); } });
-
21 Feb 2012 7:44 PM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,684
- Vote Rating
- 435
- Answers
- 3111
There isn't one built in. All the capture function did was create an interceptor to the fireEvent function. So what you could do is override Ext.mixin.Obervable hook into the fireEvent and fireAction methods:
Code:Ext.define('Override.mixin.Observable', { override : 'Ext.mixin.Observable', fireEvent : function(eventName) { console.log(eventName); this.callOverridden(arguments); }, fireAction : function(eventName) { console.log(eventName); this.callOverridden(arguments); } });Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
https://github.com/mitchellsimoens
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services services@sencha.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!
When posting code, please use BBCode's CODE tags.
-
22 Feb 2012 5:35 AM #3
-
22 Feb 2012 5:41 AM #4Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,684
- Vote Rating
- 435
- Answers
- 3111
yes it is. Just like your application classes can be dynamically loaded, using Ext.define for overrides can now be dynamically loaded also.
Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
https://github.com/mitchellsimoens
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services services@sencha.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!
When posting code, please use BBCode's CODE tags.


Reply With Quote