Engine API Reference - v2.23.0-beta.7
    Preparing search index...

    Class ListView

    A flat, selectable list of rows with cells. Rows are keyed and reconciled in place, so a list rebuilt from scratch a couple of times a second keeps its selection and scroll position and only touches the text that changed.

    Index
    • Parameters

      • container: HTMLElement

        The element to render into.

      • onSelect: (item: any, key: string | null) => void

        The selection callback.

      • OptionalonLink: (target: any) => void

        The link callback.

      Returns ListView

    container: HTMLElement

    The element the list is rendered into.

    filter: string = ''

    Case-insensitive filter on the rows' names.

    onLink: ((target: any) => void) | undefined

    Called with the target of a link cell when it is clicked.

    onSelect: (item: any, key: string | null) => void

    Called with the selected item and its row key, or null when the selection is cleared.

    selectedKey: string | null = null

    The key of the selected row, or null.

    visibleCount: number = 0

    The number of rows shown after filtering, as of the last render.

    • get rowCount(): number

      The number of rows before filtering.

      Returns number

    • get selected(): any

      The item of the selected row, or null when nothing is selected or the row is gone.

      Returns any

    • Synchronizes the DOM with the rows.

      Returns void

    • Selects a row by key.

      Parameters

      • key: string | null

        The row key, or null to clear the selection.

      Returns void

    • Selects the first row whose item is the given object.

      Parameters

      • item: any

        The item.

      Returns boolean

      Whether a row was found.

    • Replaces the rows and re-renders.

      Parameters

      • rows: ListRow[]

        The rows, in display order.

      Returns void