Composite field allowing a number of form Fields to be rendered on the same row. The fields are rendered
using an hbox layout internally, so all of the normal HBox layout config items are available. Example usage:
{
xtype: 'compositefield',
labelWidth: 120
items: [
{
xtype : 'textfield',
fieldLabel: 'Title',
width : 20
},
{
xtype : 'textfield',
fieldLabel: 'First',
flex : 1
},
{
xtype : 'textfield',
fieldLabel: 'Last',
flex : 1
}
]
}
In the example above the composite's fieldLabel will be set to 'Title, First, Last' as it groups the fieldLabels
of each of its children. This can be overridden by setting a fieldLabel on the compositefield itself:
{
xtype: 'compositefield',
fieldLabel: 'Custom label',
items: [...]
}
Any Ext.form.* component can be placed inside a composite field.
The string to use when joining segments of the built label together (defaults to ', ')
The string to use when joining segments of the built label together (defaults to ', ')
combineErrors : Boolean
True to combine errors from the individual fields into a single error message at the CompositeField level (defaults to true) defaultMargins : String
The margins to apply by default to each field in the composite fieldErrors : Ext.util.MixedCollection
MixedCollection of current errors on the Composite's subfields. This is used internally to track when
to show and hide error messages at the Composite level. Listeners are attached to the MixedCollection's
add, remove and replace events to update the error icon in the UI as errors are added or removed. isComposite : Boolean
Signifies that this is a Composite field skipLastItemMargin : Boolean
If true, the defaultMargins are not applied to the last item in the composite field set (defaults to true) Takes an object containing error messages for contained fields, returning a combined error
string (defaults to just p...
Takes an object containing error messages for contained fields, returning a combined error
string (defaults to just placing each item on a new line). This can be overridden to provide
custom combined error message handling.
Parameters
Returns
- String The combined error message
Builds a label string from an array of subfield labels.
By default this just joins the labels together with a comma
Builds a label string from an array of subfield labels.
By default this just joins the labels together with a comma
Parameters
Returns
Calls clearInvalid on all child fields. This is a convenience function and should not often need to be called
as fiel...
Calls clearInvalid on all child fields. This is a convenience function and should not often need to be called
as fields usually take care of clearing themselves
Checks each field in the composite and returns true if any is dirty
Checks each field in the composite and returns true if any is dirty
Called if combineErrors is true and a subfield's clearInvalid method is called.
By default this just updates the inte...
Called if combineErrors is true and a subfield's clearInvalid method is called.
By default this just updates the internal fieldErrors MixedCollection.
Parameters
Returns
Called if combineErrors is true and a subfield's markInvalid method is called.
By default this just adds the subfield...
Called if combineErrors is true and a subfield's markInvalid method is called.
By default this just adds the subfield's error to the internal fieldErrors MixedCollection
Parameters
Returns
Resets each field in the composite to their previous value
Resets each field in the composite to their previous value
Sorts the internal fieldErrors MixedCollection by the order in which the fields are defined.
This is called before di...
Sorts the internal fieldErrors MixedCollection by the order in which the fields are defined.
This is called before displaying errors to ensure that the errors are presented in the expected order.
This function can be overridden to provide a custom sorting order if needed.
Performs validation checks on each subfield and returns false if any of them fail validation.
Performs validation checks on each subfield and returns false if any of them fail validation.