control.ListBoxItem

Extends ICustomizable, ISelectableControl.

Drop-down list item.

Constructor | Fields | Events | Methods

Constructor

control.ListBoxItem([parameters])

Parameters:

Parameter

Default value

Description

parameters

Type: Object|String

The parameters of the item or string - the HTML content of the item.

parameters.data

Type: Object

Item data.

parameters.data.content

Type: String

Item contents.

parameters.options

Type: Object

Control options.

parameters.options.layout

'islands#listBoxItemLayout'

Type: Function|String

Constructor of the control layout which implements the ISelectableControlLayout interface or the layout key in the layout.storage. This is the base layout, which selects which of the sub-layouts to display, depending on the value of the "type" option - options.selectableLayout or options.separatorLayout. The layout constructor is passed an object containing the fields:

  • control - Reference to the control.
  • options - Options manager for the control.ListBoxItem.options.
  • data - Control data manager control.ListBoxItem.data.
  • state - Control state manager control.ListBoxItem.state.
    The layout's outward appearance changes based on the control's data, state and options. The control, in turn, reacts to layout interface events and changes the values of fields for control.ListBoxItem.state depending on the commands received.

parameters.options.selectableLayout

'islands#listBoxItemSelectableLayout'

Type: Function|String

Constructor of the list item layout which implements the ISelectableControlLayout interface or the layout key in the layout.storage. Applies to items with the option type='item'. Option for standard implementation of the list item layout.

parameters.options.selectOnClick

true

Type: Boolean

Flag that allows automatically selecting a list item when clicked.

  • If true, the list item is selected after the click and changes the value of the control.ListBoxItem.state field to 'selected'.
  • If false, the list item's appearance and state do not change after a click.

parameters.options.separatorLayout

'islands#listBoxItemSeparatorLayout'

Type: Function|String

Constructor of the list item separator layout, which implements the IControlLayout interface or the layout key in layout.storage. Applies to items with the option type='separator'. Option for standard implementation of the list item layout.

parameters.options.type

'selectable'

Type: String

Type of menu item. Depending on the value of this option, the list item layout instantiates one of the sub-layouts - options.selectableLayout or options.separatorLayout. Possible values:

  • 'selectable' - The list item is selected by a checkmark to the right of the content.
  • 'separator' - Separator.

parameters.options.visible

true

Type: Boolean

Indicates if the control is displayed.

parameters.state

Type: Object

Object describing the state of the menu item.

parameters.state.selected

false

Type: Boolean

Indicates whether the item is selected.

Fields

Name

Type

Description

data

data.Manager

Data for a list item. Names of fields that are available via the data.Manager.get method:

  • content - List item content in HTML format.
  • title - Pop-up hint text.

events

IEventManager

Event manager.

Inherited from IEventEmitter.

options

IOptionManager

Options manager.

Inherited from ICustomizable.

state

data.Manager

State of a list item. Names of fields that are available via the data.Manager.get method:

  • selected - Indicates whether the list item is selected.
  • enabled - Indicates whether the list item is active.

Events

Name

Description

click

Selecting a list item.

deselect

The control is not selected.

Inherited from ISelectableControl.

disable

The control is unavailable.

Inherited from ISelectableControl.

enable

The control is available.

Inherited from ISelectableControl.

optionschange

Change to the object options.

Inherited from ICustomizable.

parentchange

The parent object reference changed.

Data fields:

  • oldParent - Old parent.
  • newParent - New parent.

Inherited from IChild.

select

The control is selected.

Inherited from ISelectableControl.

Methods

Name

Returns

Description

deselect()

Cancels selection of the control (turns it off).

Inherited from ISelectableControl.

disable()

Makes the control unavailable (user actions are not allowed).

Inherited from ISelectableControl.

enable()

Makes the control available (user actions are allowed).

Inherited from ISelectableControl.

getMap()

Map

Returns reference to the map.

getParent()

IControlParent|null

Returns link to the parent object, or null if the parent element was not set.

Inherited from IControl.

isEnabled()

Boolean

Returns true if the control is available, or false if it is unavailable.

Inherited from ISelectableControl.

isSelected()

Boolean

Returns true if the control is selected, or false if it is not selected.

Inherited from ISelectableControl.

select()

Selects (turns on) the control.

Inherited from ISelectableControl.

setParent(parent)

IChildOnMap

Sets the parent object. If the null value is passed, the manager element will only be deleted from the current parent object.

Inherited from IControl.

Fields details

data

{data.Manager} data

Data for a list item. Names of fields that are available via the data.Manager.get method:

  • content - List item content in HTML format.
  • title - Pop-up hint text.

state

{data.Manager} state

State of a list item. Names of fields that are available via the data.Manager.get method:

  • selected - Indicates whether the list item is selected.
  • enabled - Indicates whether the list item is active.

Events details

click

Selecting a list item.

Methods details

getMap

{Map} getMap()

Returns reference to the map.