TinyBase logoTinyBase β

SortedTableInHtmlTableProps

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

{
  tableId: Id;
  cellId?: Id;
  descending?: boolean;
  offset?: number;
  limit?: number;
  store?: StoreOrStoreId;
  editable?: boolean;
  customCells?: Ids | {[cellId: Id]: string | CustomCell};
  sortOnClick?: boolean;
  paginator?: boolean | ComponentType<SortedTablePaginatorProps>;
  onChange?: (sortAndOffset: [cellId: Id | undefined, descending: boolean, offset: number]) => void;
}
TypeDescription
tableIdId

The Id of the Table in the Store to 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.

store?StoreOrStoreId

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

editable?boolean

Whether the Cells should be editable. This affects the default CellView component (to use the EditableCellView component instead) but of course will not affect custom Cell components if you have set them.

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

An optional list of Cell Ids to use for rendering a prescribed set of the Table'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 CustomCell 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 Table, 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 Table 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