What is Statics in ExtJS
Any class can define static methods, which means we do not need to instantiate the class to call the method;
eg: ClassName.methodName().
To declare a static method or property, simply define it as statics in its class property.
List of static methods for this class. For example:
Ext.define('Computer', {
statics: {
factory: function(brand) {
// 'this' in static methods refer to the class itself
return new this(brand);
}
},
constructor: function() { ... }
});
Comments
Post a Comment