Clear Up
SharpKit Reference

FieldAncestor Interface

A mixin for Ext.container.Container components that are likely to have form fields in their items subtree. Adds the following capabilities:

  • Methods for handling the addition and removal of Ext.form.Labelable and Ext.form.field.Field instances at any depth within the container.
  • Events (fieldvaliditychange and fielderrorchange) for handling changes to the state of individual fields at the container level.
  • Automatic application of fieldDefaults config properties to each field added within the container, to facilitate uniform configuration of all fields.

This mixin is primarily for internal use by Ext.form.Panel and Ext.form.FieldContainer, and should not normally need to be used directly.

Namespace: Ext.form

Properties

Name Description
className Defaults to: "Ext.Base"
configMap Defaults to: {}
initConfigList Defaults to: []
initConfigMap Defaults to: {}
isInstance Defaults to: true
self 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'
            

Methods

Name Description
handleFieldErrorChange(object, object) Handle errorchange events on sub-fields; invoke the aggregated event and method
handleFieldValidityChange(object, object) Handle validitychange events on sub-fields; invoke the aggregated event and method
initFieldAncestor() Initializes the FieldAncestor's state; this must be called from the initComponent method of any components importing this mixin.
initFieldDefaults() Initialize the fieldDefaults object
onFieldAdded(Field) Called when a Ext.form.field.Field instance is added to the container's subtree.
onFieldAncestorSubtreeChange(object, object) Handle the addition and removal of components in the FieldAncestor component's child tree.
onFieldErrorChange(Labelable, JsString) Fired when the error message of any field within the container changes.
onFieldRemoved(Field) Called when a Ext.form.field.Field instance is removed from the container's subtree.
onFieldValidityChange(Field, bool) Fired when the validity of any field within the container changes.
onLabelableAdded(Labelable) Called when a Ext.form.Labelable instance is added to the container's subtree.
onLabelableRemoved(Labelable) Called when a Ext.form.Labelable instance is removed from the container's subtree.
© Copyright 2005-2011 SharpKit. All rights reserved.