Class Dropdown

A dropdown widget with standard styling.

Index

Methods

build

  • build(): HTMLElement

getElement

  • getElement(): HTMLElement

getValue

  • getValue(): string

reset

  • reset(): void

select

  • select(index: number, executeOnChange?: boolean): void
  • Selects a value from the dropdown [listofValues]{@link Dropdown.listOfValues}.

    Parameters

    • index: number

      The 0-based index position of the value to select in the listOfValues.

    • Default value executeOnChange: boolean = true

      Indicates whether to execute the [onChange]{@link Dropdown.onChange} function when this method changes the dropdown selection.

    Returns void

setValue

  • setValue(value: string): void

Constructors

constructor

  • new Dropdown(onChange?: function, listOfValues: string[], getDisplayValue?: function, label?: string): Dropdown
  • Creates a new Dropdown.

    Parameters

    • Default value onChange: function = (dropdown: Dropdown) => {}

      The function to call when the dropdown selected value changes. This function takes the current Dropdown instance as an argument.

    • listOfValues: string[]

      The selectable values to display in the dropdown.

    • Default value getDisplayValue: function = l

      An optional function to modify the display values, rather than using the values as they appear in the listOfValues.

        • (string: any): string
        • Parameters

          • string: any

          Returns string

    • Optional label: string

      The label to use for the input for accessibility purposes.

    Returns Dropdown

Hierarchy

  • Dropdown

Implements