Show:

A.FormBuilder extension, which is responsible for all the logic related to field types.

Constructor

A.FormBuilderFieldTypes

(
  • config
)

Parameters:

  • config Object

    Object literal specifying layout builder configuration properties.

Methods

_afterFieldTypesChange

(
  • event
)
protected

Fired after the fieldTypes attribute is set.

Parameters:

_afterSelectFieldType

(
  • event
)
protected

Fired after a field type is selected by the user.

Parameters:

_checkActiveLayoutHasFieldType

(
  • fieldType
)
Boolean protected

Check on all created fields if there is one of the same type of the parameter.

Parameters:

  • fieldType Object

Returns:

Boolean:

_checkListHasFieldType

(
  • fieldList
  • fieldType
)
Boolean protected

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:

Boolean:

_hasFieldType

(
  • fieldType
  • field
)
Boolean protected

Checks if the given field is of the given field type.

Parameters:

Returns:

Boolean:

_setFieldTypes

(
  • val
)
A.FormBuilderFieldType protected

Sets the fieldTypes attribute.

Parameters:

_unregisterFieldType

(
  • fieldType
)
protected

Removes a single given field type from this form builder.

Parameters:

_unregisterFieldTypeByIndex

(
  • index
)
protected

Unregisters the field type at the given index.

Parameters:

_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.

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:

findTypeOfField

(
  • field
)

Finds the type of the given field.

Parameters:

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.FormBuilderFieldType

    This 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.FormBuilderFieldType

    This 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.

Attributes

fieldTypes

Array

The collection of field types that can be selected as fields for this form builder.

Default: []

fieldTypesModal

A.FormBuilderFieldTypesModal

The modal that will be used to select a field type.