ElementCheckboxDropdown
Index
Functions
FromList
Construct a dropdown menu with labeled checkboxes
Parameters
id: string
The ID of the element
checkboxList: readonly string[]
The checkbox labels
eventListener: (this: HTMLInputElement, event: Event) => void
The event listener to-be attached to all checkboxes
optionaloptions: { checked: boolean; parent: HTMLElement } = null
checked: boolean
Whether all checkboxes should be initially checked
parent: HTMLElement
The parent element of the dropdown menu; defaults to document.body
Returns HTMLDivElement
- The created dropdown menu
FromRecord
Construct a dropdown menu with labeled checkboxes, each group of checkboxes having a header associated with them
Parameters
id: string
The ID of the element
checkboxRecord: Record<string, readonly string[]>
The checkbox labels
eventListener: (this: HTMLInputElement, event: Event) => void
The event listener to-be attached to all checkboxes
optionaloptions: { checked: boolean; parent: HTMLElement } = null
checked: boolean
Whether all checkboxes should be initially checked
parent: HTMLElement
The parent element of the dropdown menu; defaults to document.body
Returns HTMLDivElement
- The created dropdown menu
_CreateCheckboxPair
Parameters
idPrefix: string
idSuffix: string
spanText: string
listener: (this: HTMLInputElement, event: Event) => void
checked: boolean = false
Returns HTMLOptions<label>
Namespace for creating (DOM-based) dropdown menus filled with checkboxes