app.js
Ext.define("MyClass", {
statics: {
myVar: "toto",
name: "could not be found"
}
});
Ext.onReady(function(){
console.log("MyClass.myVar = ", MyClass.myVar);
console.log("MyClass.name = ", MyClass.name);
}); |
output
MyClass.myVar = toto MyClass.name = |
But this member is not set as you can see if you execute the previous code. "Ext.Base" has a method 'getName()' and I think this is the source of my problem.
The only workaround I have found for the moment is the following:
app.js
Ext.namespace('MyClass');
MyClass.myVar = "toto";
MyClass.name = "Could not be found";
Ext.onReady(function(){
console.log("MyClass.myVar = ", MyClass.myVar);
console.log("MyClass.name = ", MyClass.name);
}); |
No comments:
Post a Comment