TinyBase logoTinyBase β

ResultSortedTableInHtmlTableProps

ResultSortedTableInHtmlTableProps props are used for components that will render a sorted Table in an HTML table, such as the SortedTableInHtmlTable component.

{
  queryId: Id;
  cellId?: Id;
  descending?: boolean;
  offset?: number;
  limit?: number;
  queries?: QueriesOrQueriesId;
  customCells?: Ids | {[cellId: Id]: string | CustomResultCell};
  sortOnClick?: boolean;
  paginator?: boolean | ComponentType<SortedTablePaginatorProps>;
  onChange?: (sortAndOffset: [cellId: Id | undefined, descending: boolean, offset: number]) => void;
}
TypeDescription
queryIdId

The Id of the query in the Queries object for which the ResultTable will be rendered.

cellId?Id

The Id of the Cell whose values are used for the sorting. If omitted, the view will sort the Row Id itself.

descending?boolean

Whether the sorting should be in descending order.

offset?number

The number of Row Ids to skip for pagination purposes.

limit?number

The maximum number of Row Ids to return.

queries?QueriesOrQueriesId

The Queries object to be accessed: omit for the default context Queries object, provide an Id for a named context Queries object, or provide an explicit reference.

customCells?Ids | {[cellId: Id]: string | CustomResultCell}

An optional list of Cell Ids to use for rendering a prescribed set of the ResultTable's Cells in a given order. This can also be an object with the desired Cell Ids as keys, and with a value that can either be a string label to show in the column header, or a ResultCustomCell object to further configure the column.

sortOnClick?boolean

Whether the table should be interactive such that clicking a header changes the sorting and/or direction.

paginator?boolean | ComponentType<SortedTablePaginatorProps>

Either true to show the default SortedTablePaginator for the ResultTable, or provide your own paginator component that takes SortedTablePaginatorProps.

onChange?(sortAndOffset: [cellId: Id | undefined, descending: boolean, offset: number]) => void

A function that is called whenever the sorting or pagination of the ResultTable is changed by the user, invoked with the sorted Cell Id, whether descending or not, and the offset of the pagination.

Since

v4.1.0