TinyBase logoTinyBase

ResultCellListener

The ResultCellListener type describes a function that is used to listen to changes to a ResultCell in a query's ResultTable.

(
  queries: Queries,
  tableId: Id,
  rowId: Id,
  cellId: Id,
  newCell: ResultCell,
  oldCell: ResultCell,
  getCellChange: GetResultCellChange,
): void
TypeDescription
queriesQueries

A reference to the Queries object that changed.

tableIdId

The Id of the ResultTable that changed, which is also the query Id.

rowIdId

The Id of the ResultRow that changed.

cellIdId

The Id of the ResultCell that changed.

newCellResultCell

The new value of the ResultCell that changed.

oldCellResultCell

The old value of the ResultCell that changed.

getCellChangeGetResultCellChange

A function that returns information about any ResultCell's changes.

returnsvoid

This has no return value.

A ResultCellListener is provided when using the addResultCellListener method. See that method for specific examples.

When called, a ResultCellListener is given a reference to the Queries object, the Id of the ResultTable that changed (which is the same as the query Id), the Id of the ResultRow that changed, and the Id of ResultCell that changed. It is also given the new value of the ResultCell, the old value of the ResultCell, and a GetResultCellChange function that can be used to query ResultCell values before and after the change.

You can create new query definitions within the body of this listener, though obviously be aware of the possible cascading effects of doing so.

Since

v2.0.0