X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/3789b528d8dd8aad4558e38e22d775bcab1cbd36..6746dc89c47ed01b165cc1152533605f97eb8e8d:/docs/source/Class.html diff --git a/docs/source/Class.html b/docs/source/Class.html index cd1f38a5..5b6de568 100644 --- a/docs/source/Class.html +++ b/docs/source/Class.html @@ -221,8 +221,9 @@ } } - /** - * @constructor + /** + * @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. @@ -426,13 +427,26 @@ 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; } }); + /** + * @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, @@ -499,6 +513,23 @@ }, true); + /** + * @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; @@ -512,6 +543,11 @@ delete data.statics; }); + /** + * @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, @@ -534,12 +570,56 @@ delete data.inheritableStatics; }); + /** + * @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; }); + /** + * @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;