Module: alfresco/forms/controls/Select

alfresco/forms/controls/Select

This control uses the standard Dojo Select control to provide a normal dropdown control.

It's possible to constrain the width of the dropdown to the width of the control (for long options), by using the forceWidth config option set to true. Additionally, long options can be forced to remain on one line and then be truncated (with an ellipsis) by using forceWidth and truncate options both set to true in the config.

Author:
  • Dave Draper
License:
Source:

Members

cssRequirements :object[]

An array of the CSS files to use with this widget.
Type:
  • object[]
Default Value:
  • [{cssFile:"./css/Select.css"}]
Source:

forceWidth :boolean

Indicates whether or not the width of the options drop-down should be constained to the width of the form control. If the width is not set then this change to the width of the last displayed value.
Type:
  • boolean
Since:
  • 1.0.37
Default Value:
  • false
Source:

truncate :boolean

Indicates whether or not the options displayed should be truncated. This can be used with forceWidth to display an ellipsis on options that are longer than the available width (rather than being displayed over multiple lines).
Type:
  • boolean
Since:
  • 1.0.37
Default Value:
  • false
Source:

width :string

An optional width to set the value of the form control.
Type:
  • string
Since:
  • 1.0.79
Default Value:
  • null
Source:

Methods

_getMenuItemForOption(option) → {Object}

Overridden to ensure the label is always set in full in the title attribute when truncating the options
Parameters:
Name Type Description
option Object The option object
Source:
Returns:
An appropriate menu item
Type
Object

_setDisplay(option) → {Object}

Overridden to ensure that width is set if required.
Parameters:
Name Type Description
option Object The option object
Since:
  • 1.0.79
Source:
Returns:
An appropriate menu item
Type
Object

createFormControl()

Source:

getWidgetConfig()

Source:

openDropDown()

Overridden to allow forceWidth to work according to the requirements of AKU-467
Source:

processOptionLabel(option, index)

Extends the inherited function to ensure that each option label is encoded to prevent potential XSS attacks.
Parameters:
Name Type Description
option object The option configuration
index number The index of the option
Source: