Ext.data.JsonP.Ext_ClassManager({"alternateClassNames":[],"aliases":{},"enum":null,"parentMixins":[],"tagname":"class","subclasses":[],"extends":null,"uses":[],"html":"
Files
Ext.ClassManager manages all classes and handles mapping from string class name to\nactual class objects throughout the whole framework. It is not generally accessed directly, rather through\nthese convenient shorthands:
\n\n\n\n\nExt.define(className, properties);\n
\n\nin which properties
is an object represent a collection of properties that apply to the class. See\ncreate for more detailed instructions.
Ext.define('Person', {\n name: 'Unknown',\n\n constructor: function(name) {\n if (name) {\n this.name = name;\n }\n },\n\n eat: function(foodType) {\n alert(\"I'm eating: \" + foodType);\n\n return this;\n }\n});\n\nvar aaron = new Person(\"Aaron\");\naaron.eat(\"Sandwich\"); // alert(\"I'm eating: Sandwich\");\n
\n\nExt.Class has a powerful set of extensible pre-processors which takes care of\neverything related to class creation, including but not limited to inheritance, mixins, configuration, statics, etc.
\n\nExt.define('Developer', {\n extend: 'Person',\n\n constructor: function(name, isGeek) {\n this.isGeek = isGeek;\n\n // Apply a method from the parent class' prototype\n this.callParent([name]);\n },\n\n code: function(language) {\n alert(\"I'm coding in: \" + language);\n\n this.eat(\"Bugs\");\n\n return this;\n }\n});\n\nvar jacky = new Developer(\"Jacky\", true);\njacky.code(\"JavaScript\"); // alert(\"I'm coding in: JavaScript\");\n // alert(\"I'm eating: Bugs\");\n
\n\nSee Ext.Base.callParent for more details on calling superclass' methods
\n\nExt.define('CanPlayGuitar', {\n playGuitar: function() {\n alert(\"F#...G...D...A\");\n }\n});\n\nExt.define('CanComposeSongs', {\n composeSongs: function() { ... }\n});\n\nExt.define('CanSing', {\n sing: function() {\n alert(\"I'm on the highway to hell...\")\n }\n});\n\nExt.define('Musician', {\n extend: 'Person',\n\n mixins: {\n canPlayGuitar: 'CanPlayGuitar',\n canComposeSongs: 'CanComposeSongs',\n canSing: 'CanSing'\n }\n})\n\nExt.define('CoolPerson', {\n extend: 'Person',\n\n mixins: {\n canPlayGuitar: 'CanPlayGuitar',\n canSing: 'CanSing'\n },\n\n sing: function() {\n alert(\"Ahem....\");\n\n this.mixins.canSing.sing.call(this);\n\n alert(\"[Playing guitar at the same time...]\");\n\n this.playGuitar();\n }\n});\n\nvar me = new CoolPerson(\"Jacky\");\n\nme.sing(); // alert(\"Ahem...\");\n // alert(\"I'm on the highway to hell...\");\n // alert(\"[Playing guitar at the same time...]\");\n // alert(\"F#...G...D...A\");\n
\n\nExt.define('SmartPhone', {\n config: {\n hasTouchScreen: false,\n operatingSystem: 'Other',\n price: 500\n },\n\n isExpensive: false,\n\n constructor: function(config) {\n this.initConfig(config);\n },\n\n applyPrice: function(price) {\n this.isExpensive = (price > 500);\n\n return price;\n },\n\n applyOperatingSystem: function(operatingSystem) {\n if (!(/^(iOS|Android|BlackBerry)$/i).test(operatingSystem)) {\n return 'Other';\n }\n\n return operatingSystem;\n }\n});\n\nvar iPhone = new SmartPhone({\n hasTouchScreen: true,\n operatingSystem: 'iOS'\n});\n\niPhone.getPrice(); // 500;\niPhone.getOperatingSystem(); // 'iOS'\niPhone.getHasTouchScreen(); // true;\niPhone.hasTouchScreen(); // true\n\niPhone.isExpensive; // false;\niPhone.setPrice(600);\niPhone.getPrice(); // 600\niPhone.isExpensive; // true;\n\niPhone.setOperatingSystem('AlienOS');\niPhone.getOperatingSystem(); // 'Other'\n
\n\nExt.define('Computer', {\n statics: {\n factory: function(brand) {\n // 'this' in static methods refer to the class itself\n return new this(brand);\n }\n },\n\n constructor: function() { ... }\n});\n\nvar dellComputer = Computer.factory('Dell');\n
\n\nAlso see Ext.Base.statics and Ext.Base.self for more details on accessing\nstatic properties within class methods
\nAll classes which were defined through the ClassManager. Keys are the\nname of the classes and the values are references to the classes.
\nDefaults to: {}
Adds a batch of class name to alias mappings
\nThe set of mappings of the form\nclassName : [values...]
\nthis
\nThe set of mappings of the form\nclassName : [values...]
\nthis
\nDefines a class.
\nThis method has been deprecated since 4.1.0
\nUse Ext.define instead, as that also supports creating overrides.
\n\nThe new Ext.ns, supports namespace rewriting
\nGet the class of the provided object; returns null if it's not an instance\nof any class created with Ext.define.
\n\ngetClass is usually invoked by the shorthand Ext.getClass.
\n\nvar component = new Ext.Component();\n\nExt.getClass(component); // returns Ext.Component\n
\nclass
\nGet the name of the class by its reference or its instance;
\n\ngetName is usually invoked by the shorthand Ext.getClassName.
\n\nExt.getName(Ext.Action); // returns \"Ext.Action\"\n
\nclassName
\nConverts a string expression to an array of matching class names. An expression can either refers to class aliases\nor class names. Expressions support wildcards:
\n\n // returns ['Ext.window.Window']\nvar window = Ext.ClassManager.getNamesByExpression('widget.window');\n\n// returns ['widget.panel', 'widget.window', ...]\nvar allWidgets = Ext.ClassManager.getNamesByExpression('widget.*');\n\n// returns ['Ext.data.Store', 'Ext.data.ArrayProxy', ...]\nvar allData = Ext.ClassManager.getNamesByExpression('Ext.data.*');\n
\nclassNames
\nInstantiate a class by its alias.
\n\ninstantiateByAlias is usually invoked by the shorthand Ext.createByAlias.
\n\nIf Ext.Loader is enabled and the class has not been defined yet, it will\nattempt to load the class via synchronous loading.
\n\nvar window = Ext.createByAlias('widget.window', { width: 600, height: 800, ... });\n
\nAdditional arguments after the alias will be passed to the\nclass constructor.
\ninstance
\nRegister the alias for a class.
\na reference to a class or a className
\nAlias to use when referring to this class
\nthis
\nInsert this post-processor at a specific position in the stack, optionally relative to\nany existing post-processor
\nThe post-processor name. Note that it needs to be registered with\nregisterPostprocessor before this
\nThe insertion position. Four possible values are:\n'first', 'last', or: 'before', 'after' (relative to the name provided in the third argument)
\nthis
\nSet the default post processors array stack which are applied to every class.
\nThe name of a registered post processor or an array of registered names.
\nthis
\nCreates a namespace and assign the value
to the created object
Ext.ClassManager.setNamespace('MyCompany.pkg.Example', someObject);\n\nalert(MyCompany.pkg.Example === someObject); // alerts true\n
\nUndefines a class defined using the #define method. Typically used\nfor unit testing where setting up and tearing down a class multiple\ntimes is required. For example:
\n\n// define a class\nExt.define('Foo', {\n ...\n});\n\n// run test\n\n// undefine the class\nExt.undefine('Foo');\n
\n\n@param {String} className The class name to undefine in string dot-namespaced format.
\n