Class: Selector

selectors~Selector(applicator, formElementId, pointer, selectorIndex, callback, disabledopt)

Class representing a selector component, which represents an module:inPlaceApplicators~InPlaceApplicator in the module:inPlaceApplicators~IPASchema tree.

The selector consists of a dropdown button with a list of choices each representing a subschema in the associated in-place applicator.

Constructor

new Selector(applicator, formElementId, pointer, selectorIndex, callback, disabledopt)

Class constructor.

Parameters:
Name Type Attributes Default Description
applicator module:inPlaceApplicators~InPlaceApplicator

The in-place applicator to be represented.

formElementId string

The id of the form element.

pointer string

The JSON Pointer to the in-place applicator represented by the first selector of the toolbar containing the newly created selector.

selectorIndex number

The index in the toolbar of the newly created selector.

callback function

The callback function for the click DOM event generated by any of the choices listed in the dropdown.

disabled boolean <optional>
false

Flag indicating whether the button should be disabled at initialization.

Implements:
Source:

Members

applicator :module:inPlaceApplicators~InPlaceApplicator

The represented in-place applicator.

Type:
Source:

button :Array.<module:selectors~Selector>

The array of selector components contained in the toolbar.

Type:
Source:

domElement :HTMLDivElement

Reference to the DOM object that contains the HTML structure of the component.

Type:
  • HTMLDivElement
Implements:
Source:

Methods

disable()

Disables the component.

Implements:
Source:

enable()

Enables the component.

Implements:
Source:

remove()

Removes the DOM elements associated to the selector.

Source:

update()

Updates the selector display.

Source:

updateSelection(selected)

Updates the underlying module:inPlaceApplicators~InPlaceApplicator and the selector display.

Parameters:
Name Type Description
selected number

Index of the selected in-place applicator subschema.

Source: