}
}
-<span id='Ext-Class-method-constructor'><span id='Ext-Class'> /**
-</span></span> * @constructor
+<span id='Ext-Class-method-constructor'> /**
+</span> * @method constructor
+ * Creates new class.
* @param {Object} classData An object represent the properties of this class
* @param {Function} createdFn Optional, the callback function to be executed when this class is fully created.
* Note that the creation process can be asynchronous depending on the pre-processors used.
index = Ext.Array.indexOf(defaultPreprocessors, relativeName);
if (index !== -1) {
- defaultPreprocessors.splice(Math.max(0, index + offset), 0, name);
+ Ext.Array.splice(defaultPreprocessors, Math.max(0, index + offset), 0, name);
}
return this;
}
});
+<span id='Ext-Class-cfg-extend'> /**
+</span> * @cfg {String} extend
+ * The parent class that this class extends. For example:
+ *
+ * Ext.define('Person', {
+ * say: function(text) { alert(text); }
+ * });
+ *
+ * Ext.define('Developer', {
+ * extend: 'Person',
+ * say: function(text) { this.callParent(["print "+text]); }
+ * });
+ */
Class.registerPreprocessor('extend', function(cls, data) {
var extend = data.extend,
base = Ext.Base,
}, true);
+<span id='Ext-Class-cfg-statics'> /**
+</span> * @cfg {Object} statics
+ * 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() { ... }
+ * });
+ *
+ * var dellComputer = Computer.factory('Dell');
+ */
Class.registerPreprocessor('statics', function(cls, data) {
var statics = data.statics,
name;
delete data.statics;
});
+<span id='Ext-Class-cfg-inheritableStatics'> /**
+</span> * @cfg {Object} inheritableStatics
+ * List of inheritable static methods for this class.
+ * Otherwise just like {@link #statics} but subclasses inherit these methods.
+ */
Class.registerPreprocessor('inheritableStatics', function(cls, data) {
var statics = data.inheritableStatics,
inheritableStatics,
delete data.inheritableStatics;
});
+<span id='Ext-Class-cfg-mixins'> /**
+</span> * @cfg {Object} mixins
+ * List of classes to mix into this class. For example:
+ *
+ * Ext.define('CanSing', {
+ * sing: function() {
+ * alert("I'm on the highway to hell...")
+ * }
+ * });
+ *
+ * Ext.define('Musician', {
+ * extend: 'Person',
+ *
+ * mixins: {
+ * canSing: 'CanSing'
+ * }
+ * })
+ */
Class.registerPreprocessor('mixins', function(cls, data) {
cls.mixin(data.mixins);
delete data.mixins;
});
+<span id='Ext-Class-cfg-config'> /**
+</span> * @cfg {Object} config
+ * List of configuration options with their default values, for which automatically
+ * accessor methods are generated. For example:
+ *
+ * Ext.define('SmartPhone', {
+ * config: {
+ * hasTouchScreen: false,
+ * operatingSystem: 'Other',
+ * price: 500
+ * },
+ * constructor: function(cfg) {
+ * this.initConfig(cfg);
+ * }
+ * });
+ *
+ * var iPhone = new SmartPhone({
+ * hasTouchScreen: true,
+ * operatingSystem: 'iOS'
+ * });
+ *
+ * iPhone.getPrice(); // 500;
+ * iPhone.getOperatingSystem(); // 'iOS'
+ * iPhone.getHasTouchScreen(); // true;
+ * iPhone.hasTouchScreen(); // true
+ */
Class.registerPreprocessor('config', function(cls, data) {
var prototype = cls.prototype;