Skip to main content

Simple Multi-Select

Classes

Type Aliases

onChangeCallback

Ƭ onChangeCallback: (multiSelectId: string, values: string[]) => void

Type declaration

▸ (multiSelectId, values): void

The expected function to call when an option is changed

Parameters
NameTypeDescription
multiSelectIdstringThe id of the multi select that was changed
valuesstring[]The selected values
Returns

void

Functions

InitializeAllMultiSelects

InitializeAllMultiSelects(root?): MultiSelect[]

This function initializes all multi-selects on the page. Searches for all native selects with the multiple attribute, insures they have not already been initialized, and initializes them.

Parameters

NameTypeDefault valueDescription
rootHTMLElement | DocumentdocumentThe root element to search for multi-selects. Defaults to the document.

Returns

MultiSelect[]

Returns an array of initialized multi-selects.