Show:

A base class for Form Field Choice.

Constructor

A.FormFieldChoice

(
  • config
)

Parameters:

  • config Object

    Object literal specifying widget configuration properties.

Methods

_afterHelpChange

() protected

Fired after the help attribute is set.

_afterNestedFieldsChange

() protected

Fired after the nestedFields attribute is set.

_afterOptionsChange

() protected

Fired after the options attribute is set.

_afterOtherOptionChange

() protected

Fired after the otherOption attribute is set.

_afterTitleChange

() protected

Fired after the title attribute is set.

_afterTypeChange

() protected

Fired after the type attribute is set.

_cleanOptionsContainer

() protected

Remove all option element from ui.

_createOptionNode

(
  • optionLabel
)
Node protected

Create a option node.

Parameters:

  • optionLabel String

Returns:

Node:

<p>A new Option Node</p>

_getFormClass

(
  • type
)
String

Gets the appropriate css class to form for the given type.

Parameters:

  • type String

Returns:

String:

_setFormType

(
  • type
)
protected

Switch option type between radio and checkbox.

Parameters:

  • type String

_uiSetHelp

(
  • help
)
protected

Updates the ui according to the value of the help attribute.

Parameters:

  • help String

_uiSetNestedFields

(
  • nestedFields
)
protected

Updates the UI according to the value of the nestedFields attribute.

Parameters:

  • nestedFields Array

_uiSetOptions

(
  • options
)
protected

Updates the ui according to the value of the options attribute.

Parameters:

  • options Array

_uiSetOtherOption

(
  • otherOption
)
protected

Updates the ui according to the value of the otherOption attribute.

Parameters:

  • otherOption Boolean

_uiSetTitle

(
  • title
)
protected

Updates the ui according to the value of the title attribute.

Parameters:

  • title String

_uiSetType

(
  • type
)
protected

Updates the ui according to the value of the type attribute.

Parameters:

  • type String

_updateOptionsContainer

() protected

Set a new options container based on type attribute.

_validateNestedFields

(
  • val
)
protected

Validates the value being set to the nestedFields attribute.

Parameters:

  • val Array

addNestedField

(
  • index
  • field
)

Adds the given field to this field's nested list.

Parameters:

destructor

() protected

Destructor lifecycle implementation for the A.FormField class. Lifecycle.

initializer

() protected

Constructor for the A.FormFieldChoice. Lifecycle.

removeNestedField

(
  • field
)

Removes the given field from this field's nested list.

Parameters:

renderUI

() protected

Create the DOM structure for the A.FormFieldChoice. Lifecycle.

Properties

ATTRS

Object static

Static property used to define the default attribute configuration for the A.FormFieldChoice.

TYPES

Object static

Static property which contains all the valid A.FormFieldChoice types.

Attributes

content

Node

Node containing the contents of this field.

help

String

Help text.

Default: ''

name

String

Id to reference form data after a form is submitted.

Default: ''

nestedFields

Array

The fields that are nested inside this field.

Default: []

options

String

The options that can be chosen.

Default: []

otherOption

Boolean

If there should be a special "Other" option.

Default: false

title

String

The title of this field.

Default: ''