TableOptions<D>
The empty definitions of below provides a base definition for the parts used by useTable, that can then be extended in the users code.
Example
export interface TableOptions<D extends object = {}}>
extends
UseExpandedOptions<D>,
UseFiltersOptions<D> {}
see https://gist.github.com/ggascoigne/646e14c9d54258e40588a13aabf0102d for more details
Extends
UseTableOptions
<D
>.UseExpandedOptions
<D
>.UseGlobalFiltersOptions
<D
>.UsePaginationOptions
<D
>.UseSortByOptions
<D
>
Extended by
Type Parameters
Type Parameter |
---|
D extends object |
Properties
autoResetExpanded?
optional autoResetExpanded: boolean;
autoResetGlobalFilter?
optional autoResetGlobalFilter: boolean;
autoResetHiddenColumns?
optional autoResetHiddenColumns: boolean;
Inherited from
UseTableOptions.autoResetHiddenColumns
autoResetPage?
optional autoResetPage: boolean;
autoResetSortBy?
optional autoResetSortBy: boolean;
cellProps()?
optional cellProps: (cell) => TableCommonProps;
Function called for each table cell allowing style/className/role props to be overridden
Parameters
Parameter | Type |
---|---|
cell | Cell <D , any > |
Returns
TableCommonProps
className?
optional className: string;
Optional method to pass style. Added to table element
columnProps()?
optional columnProps: (column) => TableCommonProps;
Function called for each table column allowing style/className/role props to be overridden
Parameters
Parameter | Type |
---|---|
column | Column <D > |
Returns
TableCommonProps
columns
columns: readonly Column<D>[];
Inherited from
UseTableOptions.columns
data
data: D[];
Inherited from
UseTableOptions.data
defaultCanSort?
optional defaultCanSort: boolean;
defaultColumn?
optional defaultColumn: Partial<Column<D>>;
Inherited from
UseTableOptions.defaultColumn
disabledMultiRemove?
optional disabledMultiRemove: boolean;
disableGlobalFilter?
optional disableGlobalFilter: boolean;
disableMultiSort?
optional disableMultiSort: boolean;
disableSortBy?
optional disableSortBy: boolean;
disableSortRemove?
optional disableSortRemove: boolean;
downloadEnabled?
optional downloadEnabled: boolean;
Enable toolbar with download option
downloadFilename?
optional downloadFilename: string;
downloadFormats?
optional downloadFormats: ("json" | "csv")[];
expandSubRows?
optional expandSubRows: boolean;
filterTypes?
optional filterTypes: FilterTypes<D>;
getRowId()?
optional getRowId: (originalRow, relativeIndex, parent?) => string;
Parameters
Parameter | Type |
---|---|
originalRow | D |
relativeIndex | number |
parent ? | Row <D > |
Returns
string
Inherited from
UseTableOptions.getRowId
getSubRows()?
optional getSubRows: (originalRow, relativeIndex) => D[];
Parameters
Parameter | Type |
---|---|
originalRow | D |
relativeIndex | number |
Returns
D
[]
Inherited from
UseTableOptions.getSubRows
globalFilter?
optional globalFilter: string | (rows, columnIds, filterValue) => Row<D>[];
headerProps()?
optional headerProps: (header) => TableCommonProps;
Function called for each table header allowing style/className/role props to be overridden
Parameters
Parameter | Type |
---|---|
header | HeaderGroup <D > |
Returns
TableCommonProps
initialState?
optional initialState: Partial<TableState<D>>;
Inherited from
UseTableOptions.initialState
isMultiSortEvent()?
optional isMultiSortEvent: (e) => boolean;
Parameters
Parameter | Type |
---|---|
e | MouseEvent <Element , MouseEvent > |
Returns
boolean
manualExpandedKey?
optional manualExpandedKey: IdType<D>;
manualGlobalFilter?
optional manualGlobalFilter: boolean;
manualPagination?
optional manualPagination: boolean;
manualSortBy?
optional manualSortBy: boolean;
maxMultiSortColCount?
optional maxMultiSortColCount: number;
orderByFn()?
optional orderByFn: (rows, sortFns, directions) => Row<D>[];
Parameters
Parameter | Type |
---|---|
rows | Row <D >[] |
sortFns | OrderByFn <D >[] |
directions | boolean [] |
Returns
Row
<D
>[]
pageCount?
optional pageCount: number;
paginateExpandedRows?
optional paginateExpandedRows: boolean;
rowProps()?
optional rowProps: (row) => TableCommonProps;
Function called for each table row allowing style/className/role props to be overridden
Parameters
Parameter | Type |
---|---|
row | Row <D > |
Returns
TableCommonProps
sortTypes?
optional sortTypes: Record<string, SortByFn<D>>;
stateReducer()?
optional stateReducer: (newState, action, previousState, instance?) => TableState<D>;
Parameters
Parameter | Type |
---|---|
newState | TableState <D > |
action | ActionType |
previousState | TableState <D > |
instance ? | TableInstance <D > |
Returns
TableState
<D
>
Inherited from
UseTableOptions.stateReducer
title?
optional title: ReactNode;
Toolbar title
useControlledState()?
optional useControlledState: (state, meta) => TableState<D>;
Parameters
Parameter | Type |
---|---|
state | TableState <D > |
meta | MetaBase <D > |
Returns
TableState
<D
>
Inherited from
UseTableOptions.useControlledState