Class ArrayModel<T>

ArrayModel wraps a JavaScript array for use in .slint views. The underlying array can be modified with the [[ArrayModel.push]] and [[ArrayModel.remove]] methods.

Type Parameters

  • T

Hierarchy

Constructors

Accessors

Methods

  • Returns IterableIterator<[number, T]>

  • Notifies the view that the complete data must be reload.

    Returns void

  • Notifies the view that multiple rows are added to the model.

    Parameters

    • row: number

      index of the first added row.

    • count: number

      the number of added items.

    Returns void

  • Notifies the view that the data of the current row is changed.

    Parameters

    • row: number

      index of the changed row.

    Returns void

  • Notifies the view that multiple rows are removed to the model.

    Parameters

    • row: number

      index of the first removed row.

    • count: number

      the number of removed items.

    Returns void

  • Pushes new values to the array that's backing the model and notifies the run-time about the added rows.

    Parameters

    • Rest ...values: T[]

    Returns void

  • Removes the specified number of element from the array that's backing the model, starting at the specified index.

    Parameters

    • index: number
    • size: number

    Returns void

  • Implementations of this function must return the current number of rows.

    Returns number

  • Implementations of this function must return the data at the specified row.

    Parameters

    • row: number

    Returns T

  • Implementations of this function must store the provided data parameter in the model at the specified row.

    Parameters

    • row: number
    • data: T

    Returns void

  • Returns IterableIterator<T>