Ext.data.JsonP.Ext_data_Field({"mixins":[],"code_type":"ext_define","inheritable":false,"component":false,"meta":{"author":["Ed Spencer"]},"mixedInto":[],"uses":[],"aliases":{"data":["field"]},"parentMixins":[],"superclasses":["Ext.Base"],"members":{"event":[],"property":[{"meta":{"private":true},"owner":"Ext.Base","tagname":"property","name":"$className","id":"property-S-className"},{"meta":{"private":true},"owner":"Ext.Base","tagname":"property","name":"configMap","id":"property-configMap"},{"meta":{"private":true},"owner":"Ext.Base","tagname":"property","name":"initConfigList","id":"property-initConfigList"},{"meta":{"private":true},"owner":"Ext.Base","tagname":"property","name":"initConfigMap","id":"property-initConfigMap"},{"meta":{"private":true},"owner":"Ext.Base","tagname":"property","name":"isInstance","id":"property-isInstance"},{"meta":{"protected":true},"owner":"Ext.Base","tagname":"property","name":"self","id":"property-self"}],"css_var":[],"method":[{"meta":{"deprecated":{"text":"as of 4.1. Use {@link #callParent} instead."},"protected":true},"owner":"Ext.Base","tagname":"method","name":"callOverridden","id":"method-callOverridden"},{"meta":{"protected":true},"owner":"Ext.Base","tagname":"method","name":"callParent","id":"method-callParent"},{"meta":{"private":true},"owner":"Ext.Base","tagname":"method","name":"configClass","id":"method-configClass"},{"meta":{"private":true},"owner":"Ext.Base","tagname":"method","name":"destroy","id":"method-destroy"},{"meta":{"private":true},"owner":"Ext.Base","tagname":"method","name":"getConfig","id":"method-getConfig"},{"meta":{},"owner":"Ext.Base","tagname":"method","name":"getInitialConfig","id":"method-getInitialConfig"},{"meta":{"private":true},"owner":"Ext.Base","tagname":"method","name":"hasConfig","id":"method-hasConfig"},{"meta":{"protected":true},"owner":"Ext.Base","tagname":"method","name":"initConfig","id":"method-initConfig"},{"meta":{"private":true},"owner":"Ext.Base","tagname":"method","name":"onConfigUpdate","id":"method-onConfigUpdate"},{"meta":{"private":true},"owner":"Ext.Base","tagname":"method","name":"setConfig","id":"method-setConfig"},{"meta":{"protected":true},"owner":"Ext.Base","tagname":"method","name":"statics","id":"method-statics"}],"css_mixin":[],"cfg":[{"meta":{"private":true},"owner":"Ext.data.Field","tagname":"cfg","name":"allowBlank","id":"cfg-allowBlank"},{"meta":{},"owner":"Ext.data.Field","tagname":"cfg","name":"convert","id":"cfg-convert"},{"meta":{},"owner":"Ext.data.Field","tagname":"cfg","name":"dateFormat","id":"cfg-dateFormat"},{"meta":{},"owner":"Ext.data.Field","tagname":"cfg","name":"defaultValue","id":"cfg-defaultValue"},{"meta":{},"owner":"Ext.data.Field","tagname":"cfg","name":"mapping","id":"cfg-mapping"},{"meta":{},"owner":"Ext.data.Field","tagname":"cfg","name":"name","id":"cfg-name"},{"meta":{},"owner":"Ext.data.Field","tagname":"cfg","name":"persist","id":"cfg-persist"},{"meta":{},"owner":"Ext.data.Field","tagname":"cfg","name":"serialize","id":"cfg-serialize"},{"meta":{},"owner":"Ext.data.Field","tagname":"cfg","name":"sortDir","id":"cfg-sortDir"},{"meta":{},"owner":"Ext.data.Field","tagname":"cfg","name":"sortType","id":"cfg-sortType"},{"meta":{},"owner":"Ext.data.Field","tagname":"cfg","name":"type","id":"cfg-type"},{"meta":{},"owner":"Ext.data.Field","tagname":"cfg","name":"useNull","id":"cfg-useNull"}]},"tagname":"class","extends":"Ext.Base","html":"

Hierarchy

Ext.Base
Ext.data.Field

Requires

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\n
Ext.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

Four 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\n
Ext.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

Types and conversion

\n\n

The 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\n

Sometimes 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\n
Ext.define('User', {\n    extend: 'Ext.data.Model',\n    fields: [\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        'name', 'email',\n        {name: 'age', type: 'int'},\n        {name: 'gender', type: 'string', defaultValue: 'Unknown'}\n    ]\n});\n
\n\n

Now when we create a new User, the firstName is populated automatically based on the name:

\n\n
var ed = Ext.create('User', {name: 'Ed Spencer'});\n\nconsole.log(ed.get('firstName')); //logs 'Ed', based on our convert function\n
\n\n

Fields which are configured with a custom convert function are read after all other fields\nwhen constructing and reading records, so that if convert functions rely on other, non-converted fields\n(as in this example), they can be sure of those fields being present.

\n\n

In fact, if we log out all of the data inside ed, we'll see this:

\n\n
console.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

The 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\n
ed.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
Defined By

Config options

Ext.data.Field
view source
: Booleanprivate
Used for validating a model. ...

Used for validating a model. Defaults to true. An empty value here will cause\nExt.data.Model.isValid to evaluate to false.

\n

Defaults to: true

A function which converts the value provided by the Reader into an object that will be stored in the Model. ...

A function which converts the value provided by the Reader into an object that will be stored in the Model.

\n\n

If configured as null, then no conversion will be applied to the raw data property when this Field\nis read. This will increase performance. but you must ensure that the data is of the correct type and does\nnot need converting.

\n\n

It is passed the following parameters:

\n\n
    \n
  • v : Mixed

    \n\n

    The data value as read by the Reader, if undefined will use the configured defaultValue.

  • \n
  • rec : Ext.data.Model

    \n\n

    The 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.

  • \n
\n\n\n

Example of convert functions:

\n\n
function fullName(v, record){\n    return record.data.last + ', ' + record.data.first;\n}\n\nfunction location(v, record){\n    return !record.data.city ? '' : (record.data.city + ', ' + record.data.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
\n
Used when converting received data into a Date when the type is specified as \"date\". ...

Used when converting received data into a Date when the type is specified as \"date\".

\n\n

The format dtring is also used when serializing Date fields for use by Writers.

\n\n

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.

\n

Defaults to: null

The default value used when the creating an instance from a raw data object, and the property referenced by the\nmappi...

The default value used when the creating an instance from a raw data object, and the property referenced by the\nmapping does not exist in that data object.

\n\n

May be specified as undefined to prevent defaulting in a value.

\n

Defaults to: ""

(Optional) A path expression for use by the Ext.data.reader.Reader implementation that is creating the\nModel to extra...

(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\n

The form of the mapping expression depends on the Reader being used.

\n\n
    \n
  • Ext.data.reader.Json

    \n\n

    The 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.

  • \n
  • Ext.data.reader.Xml

    \n\n

    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.

  • \n
  • Ext.data.reader.Array

    \n\n

    The mapping is a number indicating the Array index of the field's value. Defaults to the field specification's\nArray position.

  • \n
\n\n\n

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.

\n

Defaults to: null

Ext.data.Field
view source
: String
The name by which the field is referenced within the Model. ...

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.

\n\n

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.

\n
Ext.data.Field
view source
: Boolean
False to exclude this field from the Ext.data.Model.modified fields in a model. ...

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.

\n

Defaults to: true

A function which converts the Model's value for this Field into a form which can be used by whatever Writer\nis being ...

A function which converts the Model's value for this Field into a form which can be used by whatever Writer\nis being used to sync data with the server.

\n\n

The function should return a string which represents the Field's value.

\n\n

It is passed the following parameters:

\n\n
    \n
  • v : Mixed

    \n\n

    The Field's value - the value to be serialized.

  • \n
  • rec : Ext.data.Model

    \n\n

    The record being serialized.

  • \n
\n\n
Ext.data.Field
view source
: String
Initial direction to sort (\"ASC\" or \"DESC\"). ...

Initial direction to sort (\"ASC\" or \"DESC\"). Defaults to \"ASC\".

\n

Defaults to: "ASC"

A function which converts a Field's value to a comparable value in order to ensure correct sort ordering. ...

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
\n

Defaults to: null

Ext.data.Field
view source
: String/Object
The data type for automatic conversion from received data to the stored value if\nconvert has not been specified. ...

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

\n\n
    \n
  • auto (Default, implies no conversion)
  • \n
  • string
  • \n
  • int
  • \n
  • float
  • \n
  • boolean
  • \n
  • date
  • \n
\n\n\n

This may also be specified by referencing a member of the Ext.data.Types class.

\n\n

Developers may create their own application-specific data types by defining new members of the Ext.data.Types class.

\n
Ext.data.Field
view source
: Boolean
Use when converting received data into a INT, FLOAT, BOOL or STRING type. ...

Use when converting received data into a INT, FLOAT, BOOL or STRING type. If the value cannot be\nparsed, null will be used if useNull is true, otherwise a default value for that type will be used:

\n\n
    \n
  • for INT and FLOAT - 0.
  • \n
  • for STRING - \"\".
  • \n
  • for BOOL - false.
  • \n
\n\n\n

Note that when parsing of DATE type fails, the value will be null regardless of this setting.

\n

Defaults to: false

Properties

Defined By

Instance Properties

...
\n

Defaults to: "Ext.Base"

...
\n

Defaults to: {}

...
\n

Defaults to: []

...
\n

Defaults to: {}

...
\n

Defaults to: true

Get the reference to the current class from which this object was instantiated. ...

Get 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

\n\n
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\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
\n
Defined By

Static Properties

...
\n

Defaults to: []

Methods

Defined By

Instance Methods

( Array/Arguments args ) : Objectdeprecatedprotected
Call the original method that was previously overridden with override\n\nExt.define('My.Cat', {\n constructor: functi...

Call the original method that was previously overridden with override

\n\n
Ext.define('My.Cat', {\n    constructor: function() {\n        alert(\"I'm a cat!\");\n    }\n});\n\nMy.Cat.override({\n    constructor: function() {\n        alert(\"I'm going to be a cat!\");\n\n        this.callOverridden();\n\n        alert(\"Meeeeoooowwww\");\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
\n
\n

This method has been deprecated

\n

as of 4.1. Use callParent instead.

\n\n
\n

Parameters

  • args : Array/Arguments

    The arguments, either an array or the arguments object\nfrom the current method, for example: this.callOverridden(arguments)

    \n

Returns

  • Object

    Returns the result of calling the overridden method

    \n
( Array/Arguments args ) : Objectprotected
Call the \"parent\" method of the current method. ...

Call the \"parent\" method of the current method. That is the method previously\noverridden by derivation or by an override (see Ext.define).

\n\n
 Ext.define('My.Base', {\n     constructor: function (x) {\n         this.x = x;\n     },\n\n     statics: {\n         method: function (x) {\n             return x;\n         }\n     }\n });\n\n Ext.define('My.Derived', {\n     extend: 'My.Base',\n\n     constructor: function () {\n         this.callParent([21]);\n     }\n });\n\n var obj = new My.Derived();\n\n alert(obj.x);  // alerts 21\n
\n\n

This can be used with an override as follows:

\n\n
 Ext.define('My.DerivedOverride', {\n     override: 'My.Derived',\n\n     constructor: function (x) {\n         this.callParent([x*2]); // calls original My.Derived constructor\n     }\n });\n\n var obj = new My.Derived();\n\n alert(obj.x);  // now alerts 42\n
\n\n

This also works with static methods.

\n\n
 Ext.define('My.Derived2', {\n     extend: 'My.Base',\n\n     statics: {\n         method: function (x) {\n             return this.callParent([x*2]); // calls My.Base.method\n         }\n     }\n });\n\n alert(My.Base.method(10);     // alerts 10\n alert(My.Derived2.method(10); // alerts 20\n
\n\n

Lastly, it also works with overridden static methods.

\n\n
 Ext.define('My.Derived2Override', {\n     override: 'My.Derived2',\n\n     statics: {\n         method: function (x) {\n             return this.callParent([x*2]); // calls My.Derived2.method\n         }\n     }\n });\n\n alert(My.Derived2.method(10); // now alerts 40\n
\n

Parameters

  • args : Array/Arguments

    The arguments, either an array or the arguments object\nfrom the current method, for example: this.callParent(arguments)

    \n

Returns

  • Object

    Returns the result of calling the parent method

    \n
...
\n

Parameters

Returns the initial configuration passed to constructor when instantiating\nthis class. ...

Returns the initial configuration passed to constructor when instantiating\nthis class.

\n

Parameters

  • name : String (optional)

    Name of the config option to return.

    \n

Returns

  • Object/Mixed

    The full config object or a single config value\nwhen name parameter specified.

    \n
...
\n

Parameters

Initialize configuration for this class. ...

Initialize configuration for this class. a typical example:

\n\n
Ext.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});\n\nvar awesome = new My.awesome.Class({\n    name: 'Super Awesome'\n});\n\nalert(awesome.getName()); // 'Super Awesome'\n
\n

Parameters

Returns

( Object names, Object callback, Object scope )private
...
\n

Parameters

( Object config, Object applyIfNotSet )private
...
\n

Parameters

Get the reference to the class from which this object was instantiated. ...

Get 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

\n\n
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\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
\n

Returns

Defined By

Static Methods

( Object config )privatestatic
...
\n

Parameters

...
\n

Parameters

( Object name, Object member )privatestatic
...
\n

Parameters

Add methods / properties to the prototype of this class. ...

Add methods / properties to the prototype of this class.

\n\n
Ext.define('My.awesome.Cat', {\n    constructor: function() {\n        ...\n    }\n});\n\n My.awesome.Cat.addMembers({\n     meow: function() {\n        alert('Meowww...');\n     }\n });\n\n var kitty = new My.awesome.Cat;\n kitty.meow();\n
\n

Parameters

Add / override static properties of this class. ...

Add / override static properties of this class.

\n\n
Ext.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
\n

Parameters

Returns

( Object xtype )privatestatic
...
\n

Parameters

( Ext.Base fromClass, Array/String members ) : Ext.Baseprivatestatic
Borrow another class' members to the prototype of this class. ...

Borrow another class' members to the prototype of this class.

\n\n
Ext.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
\n

Parameters

  • fromClass : Ext.Base

    The class to borrow members from

    \n
  • members : Array/String

    The names of the members to borrow

    \n

Returns

Create a new instance of this Class. ...

Create a new instance of this Class.

\n\n
Ext.define('My.cool.Class', {\n    ...\n});\n\nMy.cool.Class.create({\n    someConfig: true\n});\n
\n\n

All parameters are passed to the constructor of the class.

\n

Returns

Create aliases for existing prototype methods. ...

Create aliases for existing prototype methods. Example:

\n\n
Ext.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
\n

Parameters

( Object config )privatestatic
...
\n

Parameters

Get the current class' name in string format. ...

Get the current class' name in string format.

\n\n
Ext.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
\n

Returns

( )deprecatedstatic
Adds members to class. ...

Adds members to class.

\n
\n

This method has been deprecated since 4.1

\n

Use addMembers instead.

\n\n
\n
( Object name, Object mixinClass )privatestatic
Used internally by the mixins pre-processor ...

Used internally by the mixins pre-processor

\n

Parameters

( Object fn, Object scope )privatestatic
...
\n

Parameters

( Object members ) : Ext.Basedeprecatedstatic
Override members of this class. ...

Override members of this class. Overridden methods can be invoked via\ncallParent.

\n\n
Ext.define('My.Cat', {\n    constructor: function() {\n        alert(\"I'm a cat!\");\n    }\n});\n\nMy.Cat.override({\n    constructor: function() {\n        alert(\"I'm going to be a cat!\");\n\n        this.callParent(arguments);\n\n        alert(\"Meeeeoooowwww\");\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
\n\n

As of 4.1, direct use of this method is deprecated. Use Ext.define\ninstead:

\n\n
Ext.define('My.CatOverride', {\n    override: 'My.Cat',\n    constructor: function() {\n        alert(\"I'm going to be a cat!\");\n\n        this.callParent(arguments);\n\n        alert(\"Meeeeoooowwww\");\n    }\n});\n
\n\n

The above accomplishes the same result but can be managed by the Ext.Loader\nwhich can properly order the override and its target class and the build process\ncan determine whether the override is needed based on the required state of the\ntarget class (My.Cat).

\n
\n

This method has been deprecated since 4.1.0

\n

Use Ext.define instead

\n\n
\n

Parameters

  • members : Object

    The properties to add to this class. This should be\nspecified as an object literal containing one or more properties.

    \n

Returns

","subclasses":[],"name":"Ext.data.Field","alternateClassNames":[],"inheritdoc":null,"files":[{"href":"Field2.html#Ext-data-Field","filename":"Field.js"}],"html_meta":{"author":null},"singleton":false,"id":"class-Ext.data.Field","statics":{"property":[{"meta":{"static":true,"private":true},"owner":"Ext.Base","tagname":"property","name":"$onExtended","id":"static-property-S-onExtended"}],"event":[],"css_var":[],"method":[{"meta":{"static":true,"private":true},"owner":"Ext.Base","tagname":"method","name":"addConfig","id":"static-method-addConfig"},{"meta":{"static":true,"private":true},"owner":"Ext.Base","tagname":"method","name":"addInheritableStatics","id":"static-method-addInheritableStatics"},{"meta":{"static":true,"private":true},"owner":"Ext.Base","tagname":"method","name":"addMember","id":"static-method-addMember"},{"meta":{"static":true},"owner":"Ext.Base","tagname":"method","name":"addMembers","id":"static-method-addMembers"},{"meta":{"static":true},"owner":"Ext.Base","tagname":"method","name":"addStatics","id":"static-method-addStatics"},{"meta":{"static":true,"private":true},"owner":"Ext.Base","tagname":"method","name":"addXtype","id":"static-method-addXtype"},{"meta":{"private":true,"static":true},"owner":"Ext.Base","tagname":"method","name":"borrow","id":"static-method-borrow"},{"meta":{"static":true},"owner":"Ext.Base","tagname":"method","name":"create","id":"static-method-create"},{"meta":{"static":true},"owner":"Ext.Base","tagname":"method","name":"createAlias","id":"static-method-createAlias"},{"meta":{"static":true,"private":true},"owner":"Ext.Base","tagname":"method","name":"extend","id":"static-method-extend"},{"meta":{"static":true},"owner":"Ext.Base","tagname":"method","name":"getName","id":"static-method-getName"},{"meta":{"deprecated":{"text":"Use {@link #addMembers} instead.","version":"4.1"},"static":true},"owner":"Ext.Base","tagname":"method","name":"implement","id":"static-method-implement"},{"meta":{"static":true,"private":true},"owner":"Ext.Base","tagname":"method","name":"mixin","id":"static-method-mixin"},{"meta":{"static":true,"private":true},"owner":"Ext.Base","tagname":"method","name":"onExtended","id":"static-method-onExtended"},{"meta":{"deprecated":{"text":"Use {@link Ext#define Ext.define} instead","version":"4.1.0"},"markdown":true,"static":true},"owner":"Ext.Base","tagname":"method","name":"override","id":"static-method-override"},{"meta":{"static":true,"private":true},"owner":"Ext.Base","tagname":"method","name":"triggerExtended","id":"static-method-triggerExtended"}],"css_mixin":[],"cfg":[]},"requires":["Ext.data.Types","Ext.data.SortTypes"]});