X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/6746dc89c47ed01b165cc1152533605f97eb8e8d..refs/heads/master:/docs/output/Ext.data.Field.js?ds=sidebyside diff --git a/docs/output/Ext.data.Field.js b/docs/output/Ext.data.Field.js index 3a82d484..055f3ffb 100644 --- a/docs/output/Ext.data.Field.js +++ b/docs/output/Ext.data.Field.js @@ -1,229 +1 @@ -Ext.data.JsonP.Ext_data_Field({ - "allMixins": [ - - ], - "deprecated": null, - "docauthor": null, - "members": { - "cfg": [ - { - "type": "Function", - "deprecated": null, - "alias": null, - "protected": false, - "tagname": "cfg", - "href": "Field3.html#Ext-data-Field-cfg-convert", - "shortDoc": "(Optional) A function which converts the value provided by the Reader into an object that will be stored\nin the Model. ...", - "static": false, - "filename": "/mnt/ebs/nightly/git/SDK/platform/src/data/Field.js", - "private": false, - "name": "convert", - "owner": "Ext.data.Field", - "doc": "
(Optional) A function which converts the value provided by the Reader into an object that will be stored\nin the Model. It is passed the following parameters:
defaultValue
.// example of convert function\nfunction fullName(v, record){\n return record.name.last + ', ' + record.name.first;\n}\n\nfunction location(v, record){\n return !record.city ? '' : (record.city + ', ' + record.state);\n}\n\nExt.define('Dude', {\n extend: 'Ext.data.Model',\n fields: [\n {name: 'fullname', convert: fullName},\n {name: 'firstname', mapping: 'name.first'},\n {name: 'lastname', mapping: 'name.last'},\n {name: 'city', defaultValue: 'homeless'},\n 'state',\n {name: 'location', convert: location}\n ]\n});\n\n// create the data store\nvar store = new Ext.data.Store({\n reader: {\n type: 'json',\n model: 'Dude',\n idProperty: 'key',\n root: 'daRoot',\n totalProperty: 'total'\n }\n});\n\nvar myData = [\n { key: 1,\n name: { first: 'Fat', last: 'Albert' }\n // notice no city, state provided in data object\n },\n { key: 2,\n name: { first: 'Barney', last: 'Rubble' },\n city: 'Bedrock', state: 'Stoneridge'\n },\n { key: 3,\n name: { first: 'Cliff', last: 'Claven' },\n city: 'Boston', state: 'MA'\n }\n];\n
\n\n",
- "linenr": 162,
- "html_filename": "Field3.html"
- },
- {
- "type": "String",
- "deprecated": null,
- "alias": null,
- "protected": false,
- "tagname": "cfg",
- "href": "Field3.html#Ext-data-Field-cfg-dateFormat",
- "shortDoc": "(Optional) Used when converting received data into a Date when the type is specified as \"date\". ...",
- "static": false,
- "filename": "/mnt/ebs/nightly/git/SDK/platform/src/data/Field.js",
- "private": false,
- "name": "dateFormat",
- "owner": "Ext.data.Field",
- "doc": "(Optional) Used when converting received data into a Date when the type is specified as \"date\"
.
A format string for the Ext.Date.parse function, or \"timestamp\" if the\nvalue provided by the Reader is a UNIX timestamp, or \"time\" if the value provided by the Reader is a\njavascript millisecond timestamp. See Ext.Date
\n\n", - "linenr": 221, - "html_filename": "Field3.html" - }, - { - "type": "Mixed", - "deprecated": null, - "alias": null, - "protected": false, - "tagname": "cfg", - "href": "Field3.html#Ext-data-Field-cfg-defaultValue", - "shortDoc": "(Optional) The default value used when a Model is being created by a Reader\nwhen the item referenced by the mapping d...", - "static": false, - "filename": "/mnt/ebs/nightly/git/SDK/platform/src/data/Field.js", - "private": false, - "name": "defaultValue", - "owner": "Ext.data.Field", - "doc": "(Optional) The default value used when a Model is being created by a Reader\nwhen the item referenced by the mapping
does not exist in the data\nobject (i.e. undefined). (defaults to \"\")
(Optional) A path expression for use by the Ext.data.reader.Reader implementation\nthat is creating the Model to extract the Field value from the data object.\nIf the path expression is the same as the field name, the mapping may be omitted.
\n\n\nThe form of the mapping expression depends on the Reader being used.
\n\n\nIf a more complex value extraction strategy is required, then configure the Field with a convert\nfunction. This is passed the whole row object, and may interrogate it in whatever way is necessary in order to\nreturn the desired data.
\n\n", - "linenr": 244, - "html_filename": "Field3.html" - }, - { - "type": "String", - "deprecated": null, - "alias": null, - "protected": false, - "tagname": "cfg", - "href": "Field3.html#Ext-data-Field-cfg-name", - "shortDoc": "The name by which the field is referenced within the Model. ...", - "static": false, - "filename": "/mnt/ebs/nightly/git/SDK/platform/src/data/Field.js", - "private": false, - "name": "name", - "owner": "Ext.data.Field", - "doc": "The name by which the field is referenced within the Model. This is referenced by, for example,\nthe dataIndex
property in column definition objects passed to Ext.grid.property.HeaderContainer.
Note: In the simplest case, if no properties other than name
are required, a field\ndefinition may consist of just a String for the field name.
False to exclude this field from the Ext.data.Model.modified fields in a model. This\nwill also exclude the field from being written using a Ext.data.writer.Writer. This option\nis useful when model fields are used to keep state on the client but do not need to be persisted\nto the server. Defaults to true.
\n", - "linenr": 301, - "html_filename": "Field3.html" - }, - { - "type": "String", - "deprecated": null, - "alias": null, - "protected": false, - "tagname": "cfg", - "href": "Field3.html#Ext-data-Field-cfg-sortDir", - "shortDoc": "(Optional) Initial direction to sort (\"ASC\" or \"DESC\"). ...", - "static": false, - "filename": "/mnt/ebs/nightly/git/SDK/platform/src/data/Field.js", - "private": false, - "name": "sortDir", - "owner": "Ext.data.Field", - "doc": "(Optional) Initial direction to sort (\"ASC\"
or \"DESC\"
). Defaults to\n\"ASC\"
.
(Optional) A function which converts a Field's value to a comparable value in order to ensure\ncorrect sort ordering. Predefined functions are provided in Ext.data.SortTypes. A custom\nsort example:
\n\n// current sort after sort we want\n// +-+------+ +-+------+\n// |1|First | |1|First |\n// |2|Last | |3|Second|\n// |3|Second| |2|Last |\n// +-+------+ +-+------+\n\nsortType: function(value) {\n switch (value.toLowerCase()) // native toLowerCase():\n {\n case 'first': return 1;\n case 'second': return 2;\n default: return 3;\n }\n}\n
\n\n",
- "linenr": 263,
- "html_filename": "Field3.html"
- },
- {
- "type": "Mixed",
- "deprecated": null,
- "alias": null,
- "protected": false,
- "tagname": "cfg",
- "href": "Field3.html#Ext-data-Field-cfg-type",
- "shortDoc": "(Optional) The data type for automatic conversion from received data to the stored value if convert\nhas not been spec...",
- "static": false,
- "filename": "/mnt/ebs/nightly/git/SDK/platform/src/data/Field.js",
- "private": false,
- "name": "type",
- "owner": "Ext.data.Field",
- "doc": "(Optional) The data type for automatic conversion from received data to the stored value if convert
\nhas not been specified. This may be specified as a string value. Possible values are
This may also be specified by referencing a member of the Ext.data.Types class.
\n\n\nDevelopers may create their own application-specific data types by defining new members of the\nExt.data.Types class.
\n\n", - "linenr": 146, - "html_filename": "Field3.html" - }, - { - "type": "Boolean", - "deprecated": null, - "alias": null, - "protected": false, - "tagname": "cfg", - "href": "Field3.html#Ext-data-Field-cfg-useNull", - "shortDoc": "(Optional) Use when converting received data into a Number type (either int or float). ...", - "static": false, - "filename": "/mnt/ebs/nightly/git/SDK/platform/src/data/Field.js", - "private": false, - "name": "useNull", - "owner": "Ext.data.Field", - "doc": "(Optional) Use when converting received data into a Number type (either int or float). If the value cannot be parsed,\nnull will be used if useNull is true, otherwise the value will be 0. Defaults to false\n\n", - "linenr": 230, - "html_filename": "Field3.html" - } - ], - "method": [ - - ], - "property": [ - - ], - "cssVar": [ - - ], - "cssMixin": [ - - ], - "event": [ - - ] - }, - "singleton": false, - "alias": null, - "superclasses": [ - - ], - "protected": false, - "tagname": "class", - "mixins": [ - - ], - "href": "Field3.html#Ext-data-Field", - "subclasses": [ - - ], - "static": false, - "author": "Ed Spencer", - "component": false, - "filename": "/mnt/ebs/nightly/git/SDK/platform/src/data/Field.js", - "private": false, - "alternateClassNames": [ - - ], - "name": "Ext.data.Field", - "doc": "
Fields are used to define what a Model is. They aren't instantiated directly - instead, when we create a class \nthat extends Ext.data.Model, it will automatically create a Field instance for each field configured in a \nModel. For example, we might set up a model like this:
\n\n\n\n\nExt.define('User', {\n extend: 'Ext.data.Model',\n fields: [\n 'name', 'email',\n {name: 'age', type: 'int'},\n {name: 'gender', type: 'string', defaultValue: 'Unknown'}\n ]\n});\n
\n\n\n\n\nFour fields will have been created for the User Model - name, email, age and gender. Note that we specified a\ncouple of different formats here; if we only pass in the string name of the field (as with name and email), the\nfield is set up with the 'auto' type. It's as if we'd done this instead:
\n\n\n\n\nExt.define('User', {\n extend: 'Ext.data.Model',\n fields: [\n {name: 'name', type: 'auto'},\n {name: 'email', type: 'auto'},\n {name: 'age', type: 'int'},\n {name: 'gender', type: 'string', defaultValue: 'Unknown'}\n ]\n});\n
\n\n\n\n\nTypes and conversion
\n\n\n\n\nThe type is important - it's used to automatically convert data passed to the field into the correct\nformat. In our example above, the name and email fields used the 'auto' type and will just accept anything that is\npassed into them. The 'age' field had an 'int' type however, so if we passed 25.4 this would be rounded to 25.
\n\n\n\n\nSometimes a simple type isn't enough, or we want to perform some processing when we load a Field's data. We can\ndo this using a convert function. Here, we're going to create a new field based on another:
\n\n\nExt.define('User', {\n extend: 'Ext.data.Model',\n fields: [\n 'name', 'email',\n {name: 'age', type: 'int'},\n {name: 'gender', type: 'string', defaultValue: 'Unknown'},\n\n {\n name: 'firstName',\n convert: function(value, record) {\n var fullName = record.get('name'),\n splits = fullName.split(\" \"),\n firstName = splits[0];\n\n return firstName;\n }\n }\n ]\n});\n\n\n\n\n\n
Now when we create a new User, the firstName is populated automatically based on the name:
\n\n\nvar ed = Ext.ModelManager.create({name: 'Ed Spencer'}, 'User');\n\nconsole.log(ed.get('firstName')); //logs 'Ed', based on our convert function\n\n\n\n\n\n
In fact, if we log out all of the data inside ed, we'll see this:
\n\n\nconsole.log(ed.data);\n\n//outputs this:\n{\n age: 0,\n email: \"\",\n firstName: \"Ed\",\n gender: \"Unknown\",\n name: \"Ed Spencer\"\n}\n\n\n\n\n\n
The age field has been given a default of zero because we made it an int type. As an auto field, email has\ndefaulted to an empty string. When we registered the User model we set gender's defaultValue to 'Unknown'\nso we see that now. Let's correct that and satisfy ourselves that the types work as we expect:
\n\n\ned.set('gender', 'Male');\ned.get('gender'); //returns 'Male'\n\ned.set('age', 25.4);\ned.get('age'); //returns 25 - we wanted an int, not a float, so no decimal places allowed\n\n\n", - "mixedInto": [ - - ], - "linenr": 1, - "xtypes": [ - - ], - "html_filename": "Field3.html", - "extends": "Object" -}); \ No newline at end of file +Ext.data.JsonP.Ext_data_Field({"tagname":"class","html":"
Hierarchy
Ext.BaseExt.data.FieldRequires
Files
Fields are used to define what a Model is. They aren't instantiated directly - instead, when we create a class that\nextends Ext.data.Model, it will automatically create a Field instance for each field configured in a Model. For example, we might set up a model like this:
\n\nExt.define('User', {\n extend: 'Ext.data.Model',\n fields: [\n 'name', 'email',\n {name: 'age', type: 'int'},\n {name: 'gender', type: 'string', defaultValue: 'Unknown'}\n ]\n});\n
\n\nFour fields will have been created for the User Model - name, email, age and gender. Note that we specified a couple\nof different formats here; if we only pass in the string name of the field (as with name and email), the field is set\nup with the 'auto' type. It's as if we'd done this instead:
\n\nExt.define('User', {\n extend: 'Ext.data.Model',\n fields: [\n {name: 'name', type: 'auto'},\n {name: 'email', type: 'auto'},\n {name: 'age', type: 'int'},\n {name: 'gender', type: 'string', defaultValue: 'Unknown'}\n ]\n});\n
\n\nThe type is important - it's used to automatically convert data passed to the field into the correct format.\nIn our example above, the name and email fields used the 'auto' type and will just accept anything that is passed\ninto them. The 'age' field had an 'int' type however, so if we passed 25.4 this would be rounded to 25.
\n\nSometimes a simple type isn't enough, or we want to perform some processing when we load a Field's data. We can do\nthis using a convert function. Here, we're going to create a new field based on another:
\n\nExt.define('User', {\n extend: 'Ext.data.Model',\n fields: [\n 'name', 'email',\n {name: 'age', type: 'int'},\n {name: 'gender', type: 'string', defaultValue: 'Unknown'},\n\n {\n name: 'firstName',\n convert: function(value, record) {\n var fullName = record.get('name'),\n splits = fullName.split(\" \"),\n firstName = splits[0];\n\n return firstName;\n }\n }\n ]\n});\n
\n\nNow when we create a new User, the firstName is populated automatically based on the name:
\n\nvar ed = Ext.create('User', {name: 'Ed Spencer'});\n\nconsole.log(ed.get('firstName')); //logs 'Ed', based on our convert function\n
\n\nIn fact, if we log out all of the data inside ed, we'll see this:
\n\nconsole.log(ed.data);\n\n//outputs this:\n{\n age: 0,\n email: \"\",\n firstName: \"Ed\",\n gender: \"Unknown\",\n name: \"Ed Spencer\"\n}\n
\n\nThe age field has been given a default of zero because we made it an int type. As an auto field, email has defaulted\nto an empty string. When we registered the User model we set gender's defaultValue to 'Unknown' so we see\nthat now. Let's correct that and satisfy ourselves that the types work as we expect:
\n\ned.set('gender', 'Male');\ned.get('gender'); //returns 'Male'\n\ned.set('age', 25.4);\ned.get('age'); //returns 25 - we wanted an int, not a float, so no decimal places allowed\n
\nA function which converts the value provided by the Reader into an object that will be stored in the Model.\nIt is passed the following parameters:
\n\nv : Mixed
\n\nThe data value as read by the Reader, if undefined will use the configured defaultValue
.
rec : Ext.data.Model
\n\nThe data object containing the Model as read so far by the Reader. Note that the Model may not be fully populated\nat this point as the fields are read in the order that they are defined in your\nfields array.
Example of convert functions:
\n\nfunction fullName(v, record){\n return record.name.last + ', ' + record.name.first;\n}\n\nfunction location(v, record){\n return !record.city ? '' : (record.city + ', ' + record.state);\n}\n\nExt.define('Dude', {\n extend: 'Ext.data.Model',\n fields: [\n {name: 'fullname', convert: fullName},\n {name: 'firstname', mapping: 'name.first'},\n {name: 'lastname', mapping: 'name.last'},\n {name: 'city', defaultValue: 'homeless'},\n 'state',\n {name: 'location', convert: location}\n ]\n});\n\n// create the data store\nvar store = Ext.create('Ext.data.Store', {\n reader: {\n type: 'json',\n model: 'Dude',\n idProperty: 'key',\n root: 'daRoot',\n totalProperty: 'total'\n }\n});\n\nvar myData = [\n { key: 1,\n name: { first: 'Fat', last: 'Albert' }\n // notice no city, state provided in data object\n },\n { key: 2,\n name: { first: 'Barney', last: 'Rubble' },\n city: 'Bedrock', state: 'Stoneridge'\n },\n { key: 3,\n name: { first: 'Cliff', last: 'Claven' },\n city: 'Boston', state: 'MA'\n }\n];\n
\nUsed when converting received data into a Date when the type is specified as \"date\"
.
A format string for the Ext.Date.parse function, or \"timestamp\" if the value provided by\nthe Reader is a UNIX timestamp, or \"time\" if the value provided by the Reader is a javascript millisecond\ntimestamp. See Ext.Date.
\nDefaults to: null
(Optional) A path expression for use by the Ext.data.reader.Reader implementation that is creating the\nModel to extract the Field value from the data object. If the path expression is the same\nas the field name, the mapping may be omitted.
\n\nThe form of the mapping expression depends on the Reader being used.
\n\nThe mapping is a string containing the javascript expression to reference the data from an element of the data\nitem's root Array. Defaults to the field name.
The mapping is an Ext.DomQuery path to the data item relative to the DOM element that represents the\nrecord. Defaults to the field name.
The mapping is a number indicating the Array index of the field's value. Defaults to the field specification's\nArray position.
If a more complex value extraction strategy is required, then configure the Field with a convert\nfunction. This is passed the whole row object, and may interrogate it in whatever way is necessary in order to\nreturn the desired data.
\nDefaults to: null
The name by which the field is referenced within the Model. This is referenced by, for example, the dataIndex
\nproperty in column definition objects passed to Ext.grid.property.HeaderContainer.
Note: In the simplest case, if no properties other than name
are required, a field definition may consist of\njust a String for the field name.
False to exclude this field from the Ext.data.Model.modified fields in a model. This will also exclude\nthe field from being written using a Ext.data.writer.Writer. This option is useful when model fields are\nused to keep state on the client but do not need to be persisted to the server. Defaults to true.
\nDefaults to: true
Initial direction to sort (\"ASC\"
or \"DESC\"
). Defaults to \"ASC\"
.
Defaults to: "ASC"
A function which converts a Field's value to a comparable value in order to ensure correct sort ordering.\nPredefined functions are provided in Ext.data.SortTypes. A custom sort example:
\n\n// current sort after sort we want\n// +-+------+ +-+------+\n// |1|First | |1|First |\n// |2|Last | |3|Second|\n// |3|Second| |2|Last |\n// +-+------+ +-+------+\n\nsortType: function(value) {\n switch (value.toLowerCase()) // native toLowerCase():\n {\n case 'first': return 1;\n case 'second': return 2;\n default: return 3;\n }\n}\n
\nDefaults to: null
The data type for automatic conversion from received data to the stored value if\nconvert
has not been specified. This may be specified as a string value.\nPossible values are
This may also be specified by referencing a member of the Ext.data.Types class.
\n\nDevelopers may create their own application-specific data types by defining new members of the Ext.data.Types class.
\nGet the reference to the current class from which this object was instantiated. Unlike statics,\nthis.self
is scope-dependent and it's meant to be used for dynamic inheritance. See statics\nfor a detailed comparison
Ext.define('My.Cat', {\n statics: {\n speciesName: 'Cat' // My.Cat.speciesName = 'Cat'\n },\n\n constructor: function() {\n alert(this.self.speciesName); / dependent on 'this'\n\n return this;\n },\n\n clone: function() {\n return new this.self();\n }\n});\n\n\nExt.define('My.SnowLeopard', {\n extend: 'My.Cat',\n statics: {\n speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard'\n }\n});\n\nvar cat = new My.Cat(); // alerts 'Cat'\nvar snowLeopard = new My.SnowLeopard(); // alerts 'Snow Leopard'\n\nvar clone = snowLeopard.clone();\nalert(Ext.getClassName(clone)); // alerts 'My.SnowLeopard'\n
\nCall the original method that was previously overridden with override
\n\nExt.define('My.Cat', {\n constructor: function() {\n alert(\"I'm a cat!\");\n\n return this;\n }\n});\n\nMy.Cat.override({\n constructor: function() {\n alert(\"I'm going to be a cat!\");\n\n var instance = this.callOverridden();\n\n alert(\"Meeeeoooowwww\");\n\n return instance;\n }\n});\n\nvar kitty = new My.Cat(); // alerts \"I'm going to be a cat!\"\n // alerts \"I'm a cat!\"\n // alerts \"Meeeeoooowwww\"\n
\nThe arguments, either an array or the arguments
object
Returns the result after calling the overridden method
\nCall the parent's overridden method. For example:
\n\nExt.define('My.own.A', {\n constructor: function(test) {\n alert(test);\n }\n});\n\nExt.define('My.own.B', {\n extend: 'My.own.A',\n\n constructor: function(test) {\n alert(test);\n\n this.callParent([test + 1]);\n }\n});\n\nExt.define('My.own.C', {\n extend: 'My.own.B',\n\n constructor: function() {\n alert(\"Going to call parent's overriden constructor...\");\n\n this.callParent(arguments);\n }\n});\n\nvar a = new My.own.A(1); // alerts '1'\nvar b = new My.own.B(1); // alerts '1', then alerts '2'\nvar c = new My.own.C(2); // alerts \"Going to call parent's overriden constructor...\"\n // alerts '2', then alerts '3'\n
\nThe arguments, either an array or the arguments
object\nfrom the current method, for example: this.callParent(arguments)
Returns the result from the superclass' method
\nInitialize configuration for this class. a typical example:
\n\nExt.define('My.awesome.Class', {\n // The default config\n config: {\n name: 'Awesome',\n isAwesome: true\n },\n\n constructor: function(config) {\n this.initConfig(config);\n\n return this;\n }\n});\n\nvar awesome = new My.awesome.Class({\n name: 'Super Awesome'\n});\n\nalert(awesome.getName()); // 'Super Awesome'\n
\nmixins The mixin prototypes as key - value pairs
\nGet the reference to the class from which this object was instantiated. Note that unlike self,\nthis.statics()
is scope-independent and it always returns the class from which it was called, regardless of what\nthis
points to during run-time
Ext.define('My.Cat', {\n statics: {\n totalCreated: 0,\n speciesName: 'Cat' // My.Cat.speciesName = 'Cat'\n },\n\n constructor: function() {\n var statics = this.statics();\n\n alert(statics.speciesName); // always equals to 'Cat' no matter what 'this' refers to\n // equivalent to: My.Cat.speciesName\n\n alert(this.self.speciesName); // dependent on 'this'\n\n statics.totalCreated++;\n\n return this;\n },\n\n clone: function() {\n var cloned = new this.self; // dependent on 'this'\n\n cloned.groupName = this.statics().speciesName; // equivalent to: My.Cat.speciesName\n\n return cloned;\n }\n});\n\n\nExt.define('My.SnowLeopard', {\n extend: 'My.Cat',\n\n statics: {\n speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard'\n },\n\n constructor: function() {\n this.callParent();\n }\n});\n\nvar cat = new My.Cat(); // alerts 'Cat', then alerts 'Cat'\n\nvar snowLeopard = new My.SnowLeopard(); // alerts 'Cat', then alerts 'Snow Leopard'\n\nvar clone = snowLeopard.clone();\nalert(Ext.getClassName(clone)); // alerts 'My.SnowLeopard'\nalert(clone.groupName); // alerts 'Cat'\n\nalert(My.Cat.totalCreated); // alerts 3\n
\nAdd / override static properties of this class.
\n\nExt.define('My.cool.Class', {\n ...\n});\n\nMy.cool.Class.addStatics({\n someProperty: 'someValue', // My.cool.Class.someProperty = 'someValue'\n method1: function() { ... }, // My.cool.Class.method1 = function() { ... };\n method2: function() { ... } // My.cool.Class.method2 = function() { ... };\n});\n
\nthis
\nBorrow another class' members to the prototype of this class.
\n\nExt.define('Bank', {\n money: '$$$',\n printMoney: function() {\n alert('$$$$$$$');\n }\n});\n\nExt.define('Thief', {\n ...\n});\n\nThief.borrow(Bank, ['money', 'printMoney']);\n\nvar steve = new Thief();\n\nalert(steve.money); // alerts '$$$'\nsteve.printMoney(); // alerts '$$$$$$$'\n
\nThe class to borrow members from
\nThe names of the members to borrow
\nthis
\nCreate a new instance of this Class.
\n\nExt.define('My.cool.Class', {\n ...\n});\n\nMy.cool.Class.create({\n someConfig: true\n});\n
\n\nAll parameters are passed to the constructor of the class.
\nthe created instance.
\nCreate aliases for existing prototype methods. Example:
\n\nExt.define('My.cool.Class', {\n method1: function() { ... },\n method2: function() { ... }\n});\n\nvar test = new My.cool.Class();\n\nMy.cool.Class.createAlias({\n method3: 'method1',\n method4: 'method2'\n});\n\ntest.method3(); // test.method1()\n\nMy.cool.Class.createAlias('method5', 'method3');\n\ntest.method5(); // test.method3() -> test.method1()\n
\nThe new method name, or an object to set multiple aliases. See\nflexSetter
\nThe original method name
\nGet the current class' name in string format.
\n\nExt.define('My.cool.Class', {\n constructor: function() {\n alert(this.self.getName()); // alerts 'My.cool.Class'\n }\n});\n\nMy.cool.Class.getName(); // 'My.cool.Class'\n
\nclassName
\nAdd methods / properties to the prototype of this class.
\n\nExt.define('My.awesome.Cat', {\n constructor: function() {\n ...\n }\n});\n\n My.awesome.Cat.implement({\n meow: function() {\n alert('Meowww...');\n }\n });\n\n var kitty = new My.awesome.Cat;\n kitty.meow();\n
\nOverride prototype members of this class. Overridden methods can be invoked via\ncallOverridden
\n\nExt.define('My.Cat', {\n constructor: function() {\n alert(\"I'm a cat!\");\n\n return this;\n }\n});\n\nMy.Cat.override({\n constructor: function() {\n alert(\"I'm going to be a cat!\");\n\n var instance = this.callOverridden();\n\n alert(\"Meeeeoooowwww\");\n\n return instance;\n }\n});\n\nvar kitty = new My.Cat(); // alerts \"I'm going to be a cat!\"\n // alerts \"I'm a cat!\"\n // alerts \"Meeeeoooowwww\"\n
\nthis
\n