Options
All
  • Public
  • Public/Protected
  • All
Menu

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

  • ArrayModel

Implements

Index

Constructors

Properties

Accessors

Methods

Constructors

constructor

  • Creates a new ArrayModel.

    Parameters

    • arr: Array<T>

    Returns ArrayModel

Properties

notify

notify: ModelPeer

Accessors

length

  • get length(): number
  • Returns number

Methods

entries

  • entries(): IterableIterator<[number, T]>
  • Returns IterableIterator<[number, T]>

push

  • push(...values: T[]): 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

remove

  • remove(index: number, size: number): void
  • Removes the specified number of element from the array that's backing the model, starting at the specified index. This is equivalent to calling Array.slice() on the array and notifying the run-time about the removed rows.

    Parameters

    • index: number
    • size: number

    Returns void

rowCount

  • rowCount(): number

rowData

  • rowData(row: number): T
  • Parameters

    • row: number

    Returns T

setRowData

  • setRowData(row: number, data: T): void
  • Parameters

    • row: number
    • data: T

    Returns void

values

  • values(): IterableIterator<T>
  • Returns IterableIterator<T>