Ext JS 4.2.1 Sencha Docs

Ext.form.field.Field

Hierarchy

Ext.Base
Ext.form.field.Field

Mixed into

Files

This mixin provides a common interface for the logical behavior and state of form fields, including:

  • Getter and setter methods for field values
  • Events and methods for tracking value and validity changes
  • Methods for triggering validation

NOTE: When implementing custom fields, it is most likely that you will want to extend the Ext.form.field.Base component class rather than using this mixin directly, as BaseField contains additional logic for generating an actual DOM complete with label and error message display and a form input field, plus methods that bind the Field value getters and setters to the input field's value.

If you do want to implement this mixin directly and don't want to extend Ext.form.field.Base, then you will most likely want to override the following methods with custom implementations: getValue, setValue, and getErrors. Other methods may be overridden as needed but their base implementations should be sufficient for common cases. You will also need to make sure that initField is called during the component's initialization.

Available since: 4.0.0

Defined By

Config options

Ext.form.field.Field
view source
: Boolean
True to disable the field. ...

True to disable the field. Disabled Fields will not be submitted.

Defaults to: false

Available since: 4.0.0

Overrides: Ext.AbstractComponent.disabled

Ext.form.field.Field
view source
: String
The name of the field. ...

The name of the field. By default this is used as the parameter name when including the field value in a form submit(). To prevent the field from being included in the form submit, set submitValue to false.

Available since: 4.0.0

Ext.form.field.Field
view source
: Boolean
Setting this to false will prevent the field from being submitted even when it is not disabled. ...

Setting this to false will prevent the field from being submitted even when it is not disabled.

Defaults to: true

Available since: 4.0.0

Ext.form.field.Field
view source
: Boolean
Specifies whether this field should be validated immediately whenever a change in its value is detected. ...

Specifies whether this field should be validated immediately whenever a change in its value is detected. If the validation results in a change in the field's validity, a validitychange event will be fired. This allows the field to show feedback about the validity of its contents immediately as the user is typing.

When set to false, feedback will not be immediate. However the form will still be validated before submitting if the clientValidation option to Ext.form.Basic.doAction is enabled, or if the field or form are validated manually.

See also Ext.form.field.Base.checkChangeEvents for controlling how changes to the field's value are detected.

Defaults to: true

Available since: 4.0.0

Ext.form.field.Field
view source
: Object

A value to initialize this field with.

A value to initialize this field with.

Available since: 4.0.0

Properties

Defined By

Instance properties

...

Defaults to: 'Ext.Base'

Available since: 4.1.1

...

Defaults to: {}

Available since: 4.1.1

...

Defaults to: []

Available since: 4.1.1

...

Defaults to: {}

Available since: 4.1.1

Ext.form.field.Field
view source
: Boolean
Flag denoting that this component is a Field. ...

Flag denoting that this component is a Field. Always true.

Defaults to: true

Available since: 4.0.0

...

Defaults to: true

Available since: 4.1.1

Ext.form.field.Field
view source
: Object
The original value of the field as configured in the value configuration, or as loaded by the last form load operatio...

The original value of the field as configured in the value configuration, or as loaded by the last form load operation if the form's trackResetOnLoad setting is true.

Available since: 4.0.0

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, this.self is scope-dependent and it's meant to be used for dynamic inheritance. See statics for a detailed comparison

Ext.define('My.Cat', {
    statics: {
        speciesName: 'Cat' // My.Cat.speciesName = 'Cat'
    },

    constructor: function() {
        alert(this.self.speciesName); // dependent on 'this'
    },

    clone: function() {
        return new this.self();
    }
});


Ext.define('My.SnowLeopard', {
    extend: 'My.Cat',
    statics: {
        speciesName: 'Snow Leopard'         // My.SnowLeopard.speciesName = 'Snow Leopard'
    }
});

var cat = new My.Cat();                     // alerts 'Cat'
var snowLeopard = new My.SnowLeopard();     // alerts 'Snow Leopard'

var clone = snowLeopard.clone();
alert(Ext.getClassName(clone));             // alerts 'My.SnowLeopard'

Available since: 4.0.0

Ext.form.field.Field
view source
: Numberprivate
...

Defaults to: 0

Available since: 4.0.0

Defined By

Static properties

...

Defaults to: []

Available since: 4.1.1

Methods

Defined By

Instance methods

Ext.form.field.Field
view source
( fn )
A utility for grouping a set of modifications which may trigger value changes into a single transaction, to prevent e...

A utility for grouping a set of modifications which may trigger value changes into a single transaction, to prevent excessive firing of change events. This is useful for instance if the field has sub-fields which are being updated as a group; you don't want the container field to check its own changed state for each subfield change.

Available since: 4.0.0

Parameters

  • fn : Object

    A function containing the transaction code

Fires

Ext.form.field.Field
view source
( )protected
Template method before a field is reset. ...

Template method before a field is reset.

Available since: 4.1.1

( args ) : Objectdeprecatedprotected
Call the original method that was previously overridden with override Ext.define('My.Cat', { constructor: functi...

Call the original method that was previously overridden with override

Ext.define('My.Cat', {
    constructor: function() {
        alert("I'm a cat!");
    }
});

My.Cat.override({
    constructor: function() {
        alert("I'm going to be a cat!");

        this.callOverridden();

        alert("Meeeeoooowwww");
    }
});

var kitty = new My.Cat(); // alerts "I'm going to be a cat!"
                          // alerts "I'm a cat!"
                          // alerts "Meeeeoooowwww"

Available since: 4.0.0

This method has been deprecated

as of 4.1. Use callParent instead.

Parameters

  • args : Array/Arguments

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

Returns

  • Object

    Returns the result of calling the overridden method

Call the "parent" method of the current method. ...

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

 Ext.define('My.Base', {
     constructor: function (x) {
         this.x = x;
     },

     statics: {
         method: function (x) {
             return x;
         }
     }
 });

 Ext.define('My.Derived', {
     extend: 'My.Base',

     constructor: function () {
         this.callParent([21]);
     }
 });

 var obj = new My.Derived();

 alert(obj.x);  // alerts 21

This can be used with an override as follows:

 Ext.define('My.DerivedOverride', {
     override: 'My.Derived',

     constructor: function (x) {
         this.callParent([x*2]); // calls original My.Derived constructor
     }
 });

 var obj = new My.Derived();

 alert(obj.x);  // now alerts 42

This also works with static methods.

 Ext.define('My.Derived2', {
     extend: 'My.Base',

     statics: {
         method: function (x) {
             return this.callParent([x*2]); // calls My.Base.method
         }
     }
 });

 alert(My.Base.method(10);     // alerts 10
 alert(My.Derived2.method(10); // alerts 20

Lastly, it also works with overridden static methods.

 Ext.define('My.Derived2Override', {
     override: 'My.Derived2',

     statics: {
         method: function (x) {
             return this.callParent([x*2]); // calls My.Derived2.method
         }
     }
 });

 alert(My.Derived2.method(10); // now alerts 40

To override a method and replace it and also call the superclass method, use callSuper. This is often done to patch a method to fix a bug.

Available since: 4.0.0

Parameters

  • args : Array/Arguments

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

Returns

  • Object

    Returns the result of calling the parent method

This method is used by an override to call the superclass method but bypass any overridden method. ...

This method is used by an override to call the superclass method but bypass any overridden method. This is often done to "patch" a method that contains a bug but for whatever reason cannot be fixed directly.

Consider:

 Ext.define('Ext.some.Class', {
     method: function () {
         console.log('Good');
     }
 });

 Ext.define('Ext.some.DerivedClass', {
     method: function () {
         console.log('Bad');

         // ... logic but with a bug ...

         this.callParent();
     }
 });

To patch the bug in DerivedClass.method, the typical solution is to create an override:

 Ext.define('App.paches.DerivedClass', {
     override: 'Ext.some.DerivedClass',

     method: function () {
         console.log('Fixed');

         // ... logic but with bug fixed ...

         this.callSuper();
     }
 });

The patch method cannot use callParent to call the superclass method since that would call the overridden method containing the bug. In other words, the above patch would only produce "Fixed" then "Good" in the console log, whereas, using callParent would produce "Fixed" then "Bad" then "Good".

Available since: 4.1.3

Parameters

  • args : Array/Arguments

    The arguments, either an array or the arguments object from the current method, for example: this.callSuper(arguments)

Returns

  • Object

    Returns the result of calling the superclass method

Ext.form.field.Field
view source
( )
Checks whether the value of the field has changed since the last time it was checked. ...

Checks whether the value of the field has changed since the last time it was checked. If the value has changed, it:

  1. Fires the change event,
  2. Performs validation if the validateOnChange config is enabled, firing the validitychange event if the validity has changed, and
  3. Checks the dirty state of the field and fires the dirtychange event if it has changed.

Available since: 4.0.0

Fires

Ext.form.field.Field
view source
( )
Checks the isDirty state of the field and if it has changed since the last time it was checked, fires the dirtychange...

Checks the isDirty state of the field and if it has changed since the last time it was checked, fires the dirtychange event.

Available since: 4.0.0

Fires

Ext.form.field.Field
view source
( )
Clear any invalid styles/messages for this field. ...

Clear any invalid styles/messages for this field. Components using this mixin should implement this method to update the components rendering to clear any existing messages.

Note: this method does not cause the Field's validate or isValid methods to return true if the value does not pass validation. So simply clearing a field's errors will not necessarily allow submission of forms submitted with the Ext.form.action.Submit.clientValidation option set.

Available since: 4.0.0

...

Available since: 4.1.1

Ext.form.field.Field
view source
( ) : HTMLElement
Only relevant if the instance's isFileUpload method returns true. ...

Only relevant if the instance's isFileUpload method returns true. Returns a reference to the file input DOM element holding the user's selected file. The input will be appended into the submission form and will not be returned, so this method should also create a replacement.

Available since: 4.0.0

Returns

  • HTMLElement
...

Available since: 4.1.0

Parameters

Ext.form.field.Field
view source
( value ) : String[]
Runs this field's validators and returns an array of error messages for any validation failures. ...

Runs this field's validators and returns an array of error messages for any validation failures. This is called internally during validation and would not usually need to be used manually.

Each subclass should override or augment the return value to provide their own errors.

Available since: 4.0.0

Parameters

  • value : Object

    The value to get errors for (defaults to the current field value)

Returns

  • String[]

    All error messages for this field; an empty Array if none.

Returns the initial configuration passed to constructor when instantiating this class. ...

Returns the initial configuration passed to constructor when instantiating this class.

Available since: 4.1.0

Parameters

  • name : String (optional)

    Name of the config option to return.

Returns

  • Object/Mixed

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

Ext.form.field.Field
view source
( ) : Object
Returns the value(s) that should be saved to the Ext.data.Model instance for this field, when Ext.form.Basic.updateRe...

Returns the value(s) that should be saved to the Ext.data.Model instance for this field, when Ext.form.Basic.updateRecord is called. Typically this will be an object with a single name-value pair, the name being this field's name and the value being its current data value. More advanced field implementations may return more than one name-value pair. The returned values will be saved to the corresponding field names in the Model.

Note that the values returned from this method are not guaranteed to have been successfully validated.

Available since: 4.0.0

Returns

  • Object

    A mapping of submit parameter names to values; each value should be a string, or an array of strings if that particular name has multiple values. It can also return null if there are no parameters to be submitted.

Fires

    Ext.form.field.Field
    view source
    ( ) : String
    Returns the name attribute of the field. ...

    Returns the name attribute of the field. This is used as the parameter name when including the field value in a form submit().

    Available since: 4.0.0

    Returns

    Ext.form.field.Field
    view source
    ( ) : Object
    Returns the parameter(s) that would be included in a standard form submit for this field. ...

    Returns the parameter(s) that would be included in a standard form submit for this field. Typically this will be an object with a single name-value pair, the name being this field's name and the value being its current stringified value. More advanced field implementations may return more than one name-value pair.

    Note that the values returned from this method are not guaranteed to have been successfully validated.

    Available since: 4.0.0

    Returns

    • Object

      A mapping of submit parameter names to values; each value should be a string, or an array of strings if that particular name has multiple values. It can also return null if there are no parameters to be submitted.

    Fires

    Ext.form.field.Field
    view source
    ( ) : Object
    Returns the current data value of the field. ...

    Returns the current data value of the field. The type of value returned is particular to the type of the particular field (e.g. a Date object for Ext.form.field.Date).

    Available since: 4.0.0

    Returns

    ...

    Available since: 4.1.0

    Parameters

    ( config ) : Ext.Basechainableprotected
    Initialize configuration for this class. ...

    Initialize configuration for this class. a typical example:

    Ext.define('My.awesome.Class', {
        // The default config
        config: {
            name: 'Awesome',
            isAwesome: true
        },
    
        constructor: function(config) {
            this.initConfig(config);
        }
    });
    
    var awesome = new My.awesome.Class({
        name: 'Super Awesome'
    });
    
    alert(awesome.getName()); // 'Super Awesome'
    

    Available since: 4.0.0

    Parameters

    Returns

    Ext.form.field.Field
    view source
    ( )
    Initializes this Field mixin on the current instance. ...

    Initializes this Field mixin on the current instance. Components using this mixin should call this method during their own initialization process.

    Available since: 4.0.0

    Fires

      Ext.form.field.Field
      view source
      ( )
      Initializes the field's value based on the initial config. ...

      Initializes the field's value based on the initial config.

      Available since: 4.0.0

      Fires

        Ext.form.field.Field
        view source
        ( ) : Boolean
        Returns true if the value of this Field has been changed from its originalValue. ...

        Returns true if the value of this Field has been changed from its originalValue. Will always return false if the field is disabled.

        Note that if the owning form was configured with trackResetOnLoad then the originalValue is updated when the values are loaded by Ext.form.Basic.setValues.

        Available since: 4.0.0

        Returns

        • Boolean

          True if this field has been changed from its original value (and is not disabled), false otherwise.

        Fires

          Ext.form.field.Field
          view source
          ( value1, value2 ) : Boolean
          Returns whether two field values are logically equal. ...

          Returns whether two field values are logically equal. Field implementations may override this to provide custom comparison logic appropriate for the particular field's data type.

          Available since: 4.0.0

          Parameters

          • value1 : Object

            The first value to compare

          • value2 : Object

            The second value to compare

          Returns

          • Boolean

            True if the values are equal, false if inequal.

          Ext.form.field.Field
          view source
          ( value1, value2 ) : Booleanprivate
          Returns whether two values are logically equal. ...

          Returns whether two values are logically equal. Similar to isEqual, however null or undefined values will be treated as empty strings.

          Available since: 4.0.7

          Parameters

          • value1 : Object

            The first value to compare

          • value2 : Object

            The second value to compare

          Returns

          • Boolean

            True if the values are equal, false if inequal.

          Ext.form.field.Field
          view source
          ( ) : Boolean
          Returns whether this Field is a file upload field; if it returns true, forms will use special techniques for submitti...

          Returns whether this Field is a file upload field; if it returns true, forms will use special techniques for submitting the form via AJAX. See Ext.form.Basic.hasUpload for details. If this returns true, the extractFileInput method must also be implemented to return the corresponding file input element.

          Available since: 4.0.0

          Returns

          Ext.form.field.Field
          view source
          ( ) : Boolean
          Returns whether or not the field value is currently valid by validating the field's current value. ...

          Returns whether or not the field value is currently valid by validating the field's current value. The validitychange event will not be fired; use validate instead if you want the event to fire. Note: disabled fields are always treated as valid.

          Implementations are encouraged to ensure that this method does not have side-effects such as triggering error message display.

          Available since: 4.0.0

          Returns

          • Boolean

            True if the value is valid, else false

          Fires

            Ext.form.field.Field
            view source
            ( errors )
            Associate one or more error messages with this field. ...

            Associate one or more error messages with this field. Components using this mixin should implement this method to update the component's rendering to display the messages.

            Note: this method does not cause the Field's validate or isValid methods to return false if the value does pass validation. So simply marking a Field as invalid will not prevent submission of forms submitted with the Ext.form.action.Submit.clientValidation option set.

            Available since: 4.0.0

            Parameters

            • errors : String/String[]

              The error message(s) for the field.

            Ext.form.field.Field
            view source
            ( newVal, oldVal )private
            Called when the field's value changes. ...

            Called when the field's value changes. Performs validation if the validateOnChange config is enabled, and invokes the dirty check.

            Available since: 4.0.0

            Parameters

            Fires

            ( names, callback, scope )private
            ...

            Available since: 4.1.0

            Parameters

            Ext.form.field.Field
            view source
            ( isDirty )private
            Called when the field's dirty state changes. ...

            Called when the field's dirty state changes.

            Available since: 4.0.0

            Parameters

            Ext.form.field.Field
            view source
            ( )
            Resets the current field value to the originally loaded value and clears any validation messages. ...

            Resets the current field value to the originally loaded value and clears any validation messages. See Ext.form.Basic.trackResetOnLoad

            Available since: 4.0.0

            Fires

              Ext.form.field.Field
              view source
              ( )
              Resets the field's originalValue property so it matches the current value. ...

              Resets the field's originalValue property so it matches the current value. This is called by Ext.form.Basic.setValues if the form's trackResetOnLoad property is set to true.

              Available since: 4.0.0

              Fires

              ( config, applyIfNotSet ) : Ext.Basechainableprivate
              ...

              Available since: 4.0.0

              Parameters

              Returns

              Ext.form.field.Field
              view source
              ( value ) : Ext.form.field.Fieldchainable
              Sets a data value into the field and runs the change detection and validation. ...

              Sets a data value into the field and runs the change detection and validation.

              Available since: 4.0.0

              Parameters

              • value : Object

                The value to set

              Returns

              Fires

              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, this.statics() is scope-independent and it always returns the class from which it was called, regardless of what this points to during run-time

              Ext.define('My.Cat', {
                  statics: {
                      totalCreated: 0,
                      speciesName: 'Cat' // My.Cat.speciesName = 'Cat'
                  },
              
                  constructor: function() {
                      var statics = this.statics();
              
                      alert(statics.speciesName);     // always equals to 'Cat' no matter what 'this' refers to
                                                      // equivalent to: My.Cat.speciesName
              
                      alert(this.self.speciesName);   // dependent on 'this'
              
                      statics.totalCreated++;
                  },
              
                  clone: function() {
                      var cloned = new this.self;                      // dependent on 'this'
              
                      cloned.groupName = this.statics().speciesName;   // equivalent to: My.Cat.speciesName
              
                      return cloned;
                  }
              });
              
              
              Ext.define('My.SnowLeopard', {
                  extend: 'My.Cat',
              
                  statics: {
                      speciesName: 'Snow Leopard'     // My.SnowLeopard.speciesName = 'Snow Leopard'
                  },
              
                  constructor: function() {
                      this.callParent();
                  }
              });
              
              var cat = new My.Cat();                 // alerts 'Cat', then alerts 'Cat'
              
              var snowLeopard = new My.SnowLeopard(); // alerts 'Cat', then alerts 'Snow Leopard'
              
              var clone = snowLeopard.clone();
              alert(Ext.getClassName(clone));         // alerts 'My.SnowLeopard'
              alert(clone.groupName);                 // alerts 'Cat'
              
              alert(My.Cat.totalCreated);             // alerts 3
              

              Available since: 4.0.0

              Returns

              Ext.form.field.Field
              view source
              ( value ) : Objectprotected
              Allows for any necessary modifications before the original value is set ...

              Allows for any necessary modifications before the original value is set

              Available since: 4.1.1

              Parameters

              • value : Object

                The initial value

              Returns

              • Object

                The modified initial value

              Ext.form.field.Field
              view source
              ( ) : Boolean
              Returns whether or not the field value is currently valid by validating the field's current value, and fires the vali...

              Returns whether or not the field value is currently valid by validating the field's current value, and fires the validitychange event if the field's validity has changed since the last validation. Note: disabled fields are always treated as valid.

              Custom implementations of this method are allowed to have side-effects such as triggering error message display. To validate without side-effects, use isValid.

              Available since: 4.0.0

              Returns

              • Boolean

                True if the value is valid, else false

              Fires

              Defined By

              Static methods

              ( config )privatestatic
              ...

              Available since: 4.1.1

              Parameters

              ( members )chainableprivatestatic
              ...

              Available since: 4.1.1

              Parameters

              ( name, member )chainableprivatestatic
              ...

              Available since: 4.1.1

              Parameters

              ( members )chainablestatic
              Add methods / properties to the prototype of this class. ...

              Add methods / properties to the prototype of this class.

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

              Available since: 4.1.0

              Parameters

              ( members ) : Ext.Basechainablestatic
              Add / override static properties of this class. ...

              Add / override static properties of this class.

              Ext.define('My.cool.Class', {
                  ...
              });
              
              My.cool.Class.addStatics({
                  someProperty: 'someValue',      // My.cool.Class.someProperty = 'someValue'
                  method1: function() { ... },    // My.cool.Class.method1 = function() { ... };
                  method2: function() { ... }     // My.cool.Class.method2 = function() { ... };
              });
              

              Available since: 4.0.2

              Parameters

              Returns

              ( xtype )chainableprivatestatic
              ...

              Available since: 4.1.1

              Parameters

              ( fromClass, members ) : Ext.Basechainableprivatestatic
              Borrow another class' members to the prototype of this class. ...

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

              Ext.define('Bank', {
                  money: '$$$',
                  printMoney: function() {
                      alert('$$$$$$$');
                  }
              });
              
              Ext.define('Thief', {
                  ...
              });
              
              Thief.borrow(Bank, ['money', 'printMoney']);
              
              var steve = new Thief();
              
              alert(steve.money); // alerts '$$$'
              steve.printMoney(); // alerts '$$$$$$$'
              

              Available since: 4.0.2

              Parameters

              • fromClass : Ext.Base

                The class to borrow members from

              • members : Array/String

                The names of the members to borrow

              Returns

              Create a new instance of this Class. ...

              Create a new instance of this Class.

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

              All parameters are passed to the constructor of the class.

              Available since: 4.0.2

              Returns

              Overrides: Ext.layout.Layout.create

              ( alias, origin )static
              Create aliases for existing prototype methods. ...

              Create aliases for existing prototype methods. Example:

              Ext.define('My.cool.Class', {
                  method1: function() { ... },
                  method2: function() { ... }
              });
              
              var test = new My.cool.Class();
              
              My.cool.Class.createAlias({
                  method3: 'method1',
                  method4: 'method2'
              });
              
              test.method3(); // test.method1()
              
              My.cool.Class.createAlias('method5', 'method3');
              
              test.method5(); // test.method3() -> test.method1()
              

              Available since: 4.0.2

              Parameters

              ( config )privatestatic
              ...

              Available since: 4.1.1

              Parameters

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

              Get the current class' name in string format.

              Ext.define('My.cool.Class', {
                  constructor: function() {
                      alert(this.self.getName()); // alerts 'My.cool.Class'
                  }
              });
              
              My.cool.Class.getName(); // 'My.cool.Class'
              

              Available since: 4.0.4

              Returns

              ( )deprecatedstatic
              Adds members to class. ...

              Adds members to class.

              Available since: 4.0.2

              This method has been deprecated since 4.1

              Use addMembers instead.

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

              Used internally by the mixins pre-processor

              Available since: 4.1.1

              Parameters

              ( fn, scope )chainableprivatestatic
              ...

              Available since: 4.1.1

              Parameters

              ( members ) : Ext.Basechainabledeprecatedstatic
              Override members of this class. ...

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

              Ext.define('My.Cat', {
                  constructor: function() {
                      alert("I'm a cat!");
                  }
              });
              
              My.Cat.override({
                  constructor: function() {
                      alert("I'm going to be a cat!");
              
                      this.callParent(arguments);
              
                      alert("Meeeeoooowwww");
                  }
              });
              
              var kitty = new My.Cat(); // alerts "I'm going to be a cat!"
                                        // alerts "I'm a cat!"
                                        // alerts "Meeeeoooowwww"
              

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

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

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

              Available since: 4.0.2

              This method has been deprecated since 4.1.0

              Use Ext.define instead

              Parameters

              • members : Object

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

              Returns

              ...

              Available since: 4.1.1

              Defined By

              Events

              Ext.form.field.Field
              view source
              ( this, newValue, oldValue, eOpts )
              Fires when the value of a field is changed via the setValue method. ...

              Fires when the value of a field is changed via the setValue method.

              Available since: 4.0.0

              Parameters

              Ext.form.field.Field
              view source
              ( this, isDirty, eOpts )
              Fires when a change in the field's isDirty state is detected. ...

              Fires when a change in the field's isDirty state is detected.

              Available since: 4.0.0

              Parameters

              Ext.form.field.Field
              view source
              ( this, isValid, eOpts )
              Fires when a change in the field's validity is detected. ...

              Fires when a change in the field's validity is detected.

              Available since: 4.0.0

              Parameters