-
26 Sep 2012 11:37 AM #1
Unanswered: Reference static in static
Unanswered: Reference static in static
I tried this, self, Class name.
Example:
statics: {
A: 'something',
B: className.A
}
-
26 Sep 2012 11:23 PM #2
How about this.self?
EDIT: Sorry, slightly misunderstood the question. You're right, there seems to be no way of doing this because there is no object to work with at the time when the statics are evaluated. You can reference static variables in static functions though, maybe that helps:
and then laterCode:statics : { A : 'something', B : function() { return this.A; } }
Code:console.log(My.cool.Class.B());
-
26 Sep 2012 11:57 PM #3
Code:Ext.define('MyClass',{ statics: (function(){ var str="something"; return { A: str, B: str }; })() })I write English by translator.
-
27 Sep 2012 12:35 AM #4
Well, I guess there is a way to do this after all.

Nice one haduki


Reply With Quote