Options
All
  • Public
  • Public/Protected
  • All
Menu

Represents a container with a scrollable list of items.

Hierarchy

Index

Constructors

constructor

  • new ListBox(): any
  • Creates a new listbox.

    Returns any

Properties

eventQueue

eventQueue: EmitterEvent[]

uiComponent

uiComponent: Element

The underlying HTML element.

Methods

_deselectAll

  • _deselectAll(): void
  • [internal] Deselects all items.

    Returns void

addItem

  • addItem(label: String, id?: string): HTMLDivElement
  • Adds an item to the listbox.

    Parameters

    • label: String

      The label of the item.

    • Optional id: string

      The ID of the item.

    Returns HTMLDivElement

    The underlying item element.

clear

  • clear(): void
  • Clears all items.

    Returns void

destroy

  • destroy(): void
  • Destroys the UI component.

    Returns void

emit

  • emit(evtName: String, ...args: any): void
  • Fires an event.

    Parameters

    • evtName: String

      The event name to fire.

    • Rest ...args: any

      The arguments to pass.

    Returns void

getElement

  • getElement(): Element
  • Returns the element for this UI component.

    Returns Element

getSize

  • getSize(): { height: Number; w: Number }
  • Returns the size of the component.

    Returns { height: Number; w: Number }

    • height: Number
    • w: Number

init

  • init(): void
  • Optional initialization code.

    Returns void

on

  • on(evtName: String, callback: Function): void
  • Listens for an event.

    Parameters

    • evtName: String

      The event name to listen for.

    • callback: Function

      The callback to assign.

    Returns void

once

  • once(evtName: String, callback: Function): void
  • Listens for an event once.

    Parameters

    • evtName: String

      The event name to listen for.

    • callback: Function

      The callback to assign.

    Returns void

onitemdeselected

  • onitemdeselected(id: String): void
  • Called when the item is no longer selected.

    Parameters

    • id: String

    Returns void

onitemselected

  • onitemselected(id: String): void
  • Called upon item selection.

    Parameters

    • id: String

    Returns void

selectItem

  • selectItem(id: String): boolean
  • Selects an item.

    Parameters

    • id: String

      The ID of the item to select.

    Returns boolean

    Whether the item selection was successful.

setSize

  • setSize(w: string | number, h: string | number): void
  • Sets the size of the component.

    Parameters

    • w: string | number

      CSS prefixed width.

    • h: string | number

      CSS prefixed height.

    Returns void

Generated using TypeDoc