TinyBase logoTinyBase

SortedRowIdsListener

The SortedRowIdsListener type describes a function that is used to listen to changes to sorted Row Ids in a Table.

(
  store: Store,
  tableId: Id,
  cellId: Id | undefined,
  descending: boolean,
  offset: number,
  limit: number | undefined,
  sortedRowIds: Ids,
): void
TypeDescription
storeStore

A reference to the Store that changed.

tableIdId

The Id of the Table whose sorted Row Ids changed.

cellIdId | undefined

The Id of the Cell whose values were used for the sorting.

descendingboolean

Whether the sorting was in descending order.

offsetnumber

The number of Row Ids skipped.

limitnumber | undefined

The maximum number of Row Ids returned.

sortedRowIdsIds

The sorted Row Ids themselves.

returnsvoid

This has no return value.

A SortedRowIdsListener is provided when using the addSortedRowIdsListener method. See that method for specific examples.

When called, a SortedRowIdsListener is given a reference to the Store, the Id of the Table whose Row Ids sorting changed, the Cell Id being used to sort them, whether descending or not, and the offset and limit of the number of Ids returned, for pagination purposes. It also receives the sorted array of Ids itself, so that you can use them in the listener without the additional cost of an explicit call to getSortedRowIds.

Since

v2.0.0