A.FormBuilderFieldTypes Class
A.FormBuilder extension, which is responsible for all the logic related
to field types.
Constructor
A.FormBuilderFieldTypes
-
config
Parameters:
-
configObjectObject literal specifying layout builder configuration properties.
Index
Methods
- _afterFieldTypesChange
- _afterSelectFieldType
- _checkActiveLayoutHasFieldType
- _checkListHasFieldType
- _hasFieldType
- _setFieldTypes
- _unregisterFieldType
- _unregisterFieldTypeByIndex
- _updateUniqueFieldType
- _valueFieldTypesModal
- destructor
- disableUniqueFieldType
- findTypeOfField
- hideFieldsPanel
- initializer
- registerFieldTypes
- showFieldsPanel
- unregisterFieldTypes
Properties
- ATTRS static
Attributes
Methods
_afterFieldTypesChange
-
event
Fired after the fieldTypes attribute is set.
Parameters:
-
eventEventFacade
_afterSelectFieldType
-
event
Fired after a field type is selected by the user.
Parameters:
-
eventEventFacade
_checkActiveLayoutHasFieldType
-
fieldType
Check on all created fields if there is one of the same type of the parameter.
Parameters:
-
fieldTypeObject
Returns:
_checkListHasFieldType
-
fieldList -
fieldType
Checks on all fields of a field list if there is one of the same type of the parameter.
Parameters:
-
fieldListA.FormBuilderFIeldList -
fieldTypeObject
Returns:
_hasFieldType
-
fieldType -
field
Checks if the given field is of the given field type.
Parameters:
-
fieldTypeA.FormBuilderFieldType -
fieldA.FormField
Returns:
_setFieldTypes
-
val
Sets the fieldTypes attribute.
Parameters:
-
valObject | A.FormBuilderFieldType
Returns:
_unregisterFieldType
-
fieldType
Removes a single given field type from this form builder.
Parameters:
-
fieldTypeString | A.FormBuilderFieldType
_unregisterFieldTypeByIndex
-
index
Unregisters the field type at the given index.
Parameters:
-
indexNumber
_updateUniqueFieldType
()
protected
Enable or disable unique FieldTypes based on created Fields.
_valueFieldTypesModal
()
A.FormBuilderFieldTypesModal
protected
Default value for the modal displayed to select a field.
Returns:
destructor
()
protected
Destructor lifecycle implementation for the A.FormBuilderFieldTypes class.
Lifecycle.
disableUniqueFieldType
-
field
Disables unique fields for the field class that the given field is an instance of.
Parameters:
-
fieldA.FormField
findTypeOfField
-
field
Finds the type of the given field.
Parameters:
-
fieldA.FormBuilderFieldBase
hideFieldsPanel
()
Hides the fields modal.
initializer
()
protected
Construction logic executed during the A.FormBuilderFieldTypes
instantiation. Lifecycle.
registerFieldTypes
-
typesToAdd
Adds a the given field types to this form builder.
Parameters:
-
typesToAddArray | Object | A.FormBuilderFieldTypeThis can be either an array of items or a single item. Each item should be either an instance of
A.FormBuilderFieldType, or the configuration object to be used when instantiating one.
showFieldsPanel
()
Shows the fields modal.
unregisterFieldTypes
-
typesToRemove
Removes the given field types from this form builder.
Parameters:
-
typesToRemoveArray | String | A.FormBuilderFieldTypeThis can be either an array of items, or a single one. For each item, if it's a string, the form builder will remove all registered field types with a field class that matches it. For items that are instances of
A.FormBuilderFieldType, only the same instances will be removed.
Properties
ATTRS
Object
static
Static property used to define the default attribute
configuration for the A.FormBuilderFieldTypes.