class type statics =object
..end
method addMembers : 'a. 'a Js.t -> unit Js.meth
Add methods / properties to the prototype of this class.
Ext.define('My.awesome.Cat', {
constructor: function() {
...
}
});
My.awesome.Cat.addMembers({
meow: function() {
alert('Meowww...');
}
});
var kitty = new My.awesome.Cat;
kitty.meow();
Parameters:
_ Js.t
method addStatics : 'b 'c. 'b Js.t -> 'c Js.t Js.meth
Add / override static properties of this class.
Ext.define('My.cool.Class', {
...
});
My.cool.Class.addStatics({
someProperty: 'someValue', // My.cool.Class.someProperty = 'someValue'
method1: function() { ... }, // My.cool.Class.method1 = function() { ... };
method2: function() { ... } // My.cool.Class.method2 = function() { ... };
});
Parameters:
_ Js.t
Returns:
#Ext_Base.t Js.t
this
method create : 'd. 'd Js.t Js.meth
Create a new instance of this Class.
Ext.define('My.cool.Class', {
...
});
My.cool.Class.create({
someConfig: true
});
All parameters are passed to the constructor of the class.
Returns:
_ Js.t
the created instance.
method createAlias : 'e 'f. 'e Js.t -> 'f Js.t -> unit Js.meth
Create aliases for existing prototype methods. Example:
Ext.define('My.cool.Class', {
method1: function() { ... },
method2: function() { ... }
});
var test = new My.cool.Class();
My.cool.Class.createAlias({
method3: 'method1',
method4: 'method2'
});
test.method3(); // test.method1()
My.cool.Class.createAlias('method5', 'method3');
test.method5(); // test.method3() -> test.method1()
Parameters:
_ Js.t
The new method name, or an object to set multiple aliases. See flexSetter
_ Js.t
The original method name
method getName : Js.js_string Js.t Js.meth
Get the current class' name in string format.
Ext.define('My.cool.Class', {
constructor: function() {
alert(this.self.getName()); // alerts 'My.cool.Class'
}
});
My.cool.Class.getName(); // 'My.cool.Class'
Returns:
Js.js_string Js.t
className