-
4 Apr 2012 12:31 AM #1
[4.1.0-RC2] Error defining mixins that themselves use Ext.util.Observable
[4.1.0-RC2] Error defining mixins that themselves use Ext.util.Observable
REQUIRED INFORMATION
Ext version tested:- Ext 4.1.0-RC2 (broken)
- Ext 4.0.7 (works)
Browser versions tested against:- Chrome 18
- IE9
- FF11
DOCTYPE tested against:- does not apply
Description:- defining mixins that themselves use the Observable mixin does not work
Steps to reproduce the problem:- define a mixin M that itself has the mixin Ext.util.Observable
- define a class C that has mixin M
The result that was expected:- when instantiated, class C should have both mixin M and Ext.util.Observable
The result that occurs instead:- Ext bombs out with "this.prepareClass is not a function" in Method Ext.util.Observable.onClassMixedIn() when calling Ext.define('C', ...)
Test Case:
Code:Ext.define('M', { mixins: { observable: 'Ext.util.Observable' }, mixinMethod: function () { // do something } }); Ext.define('C', { mixins: { m: 'M' }, someMethod: function () { this.mixinMethod(); } });
HELPFUL INFORMATION
Screenshot or Video:- none
See this URL for live test case: http://jsfiddle.net/yLACs/ (working version with Ext 4.0.7)
Debugging already done:- none
Possible fix:- not provided
Additional CSS used:- does not apply
Operating System:- Windows 7 Enterprise N
-
4 Apr 2012 8:35 AM #2
This has been assigned. Thank you for the report.
Regards,
Scott.
-
7 May 2012 11:51 PM #3
This has not been fixed in 4.1, apparently. I do not think we are going to keep using Ext JS in the future.
-
7 May 2012 11:55 PM #4
The issue has been resolved, for some reason the status hasn't been updated:
Code:Ext.require('*'); Ext.onReady(function() { Ext.define('M', { mixins: { observable: 'Ext.util.Observable' }, mixinMethod: function() { // do something } }); Ext.define('C', { mixins: { m: 'M' }, someMethod: function() { this.mixinMethod(); } }); var c = new C(); console.log(c.fireEvent, c.mixinMethod); });Evan Trimboli
Sencha Developer
Twitter - @evantrimboli
Don't be afraid of the source code!
-
8 May 2012 12:05 AM #5
I still doesn't work for us. For some reason the core seems to be an RC still:
Anyway, we'll stick to 4.0.7 for the time being. Other developers had poor experience with the support from Sencha as well and I think we're done with Ext JS anyway.Code:>> Ext.versions Object { core=4.1.0rc, extjs=4.1.0}
-
8 May 2012 12:18 AM #6
Sounds like you don't have the latest version then (or perhaps a caching issue), you can grab 4.1 final from here: http://www.sencha.com/products/extjs/download/
Evan Trimboli
Sencha Developer
Twitter - @evantrimboli
Don't be afraid of the source code!
-
8 May 2012 1:02 AM #7
Not sure how it happened, but you were right. I've hotlinked http://dev.sencha.com/deploy/ext-4.1...t-all-debug.js for testing purposes, but it still doesn't work.
Code:me.hasListeners is undefined (ext-all-debug.js (line 24600))
-
8 May 2012 1:05 AM #8
I don't see that against 4.1.0 final. What happens if you go to:
http://dev.sencha.com/deploy/ext-4.1...rray-grid.html
Then drop this in the console:
Also, when you say "doesn't work", at what point does it crash?Code:Ext.define('M', { mixins: { observable: 'Ext.util.Observable' }, mixinMethod: function() { // do something } }); Ext.define('C', { mixins: { m: 'M' }, someMethod: function() { this.mixinMethod(); } }); var c = new C(); console.log(c.fireEvent, c.mixinMethod);Evan Trimboli
Sencha Developer
Twitter - @evantrimboli
Don't be afraid of the source code!
-
8 May 2012 1:24 AM #9
It may work with the simplistic code snippet I provided initially, but it doesn't work in our real-life application.
Thanks for your effort, but don't bother. We're done with Ext JS, we've had too many BC-breaks even in minor releases.
Success! Looks like we've fixed this one. According to our records the fix was applied for
EXTJSIV-5815
in
4.1.


Reply With Quote