A.FormBuilderFieldTypes Class
A.FormBuilder
extension, which is responsible for all the logic related
to field types.
Constructor
A.FormBuilderFieldTypes
-
config
Parameters:
-
config
ObjectObject 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:
-
event
EventFacade
_afterSelectFieldType
-
event
Fired after a field type is selected by the user.
Parameters:
-
event
EventFacade
_checkActiveLayoutHasFieldType
-
fieldType
Check on all created fields if there is one of the same type of the parameter.
Parameters:
-
fieldType
Object
Returns:
_checkListHasFieldType
-
fieldList
-
fieldType
Checks on all fields of a field list if there is one of the same type of the parameter.
Parameters:
-
fieldList
A.FormBuilderFIeldList -
fieldType
Object
Returns:
_hasFieldType
-
fieldType
-
field
Checks if the given field is of the given field type.
Parameters:
-
fieldType
A.FormBuilderFieldType -
field
A.FormField
Returns:
_setFieldTypes
-
val
Sets the fieldTypes
attribute.
Parameters:
-
val
Object | A.FormBuilderFieldType
Returns:
_unregisterFieldType
-
fieldType
Removes a single given field type from this form builder.
Parameters:
-
fieldType
String | A.FormBuilderFieldType
_unregisterFieldTypeByIndex
-
index
Unregisters the field type at the given index.
Parameters:
-
index
Number
_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:
-
field
A.FormField
findTypeOfField
-
field
Finds the type of the given field.
Parameters:
-
field
A.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:
-
typesToAdd
Array | 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:
-
typesToRemove
Array | 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
.