PaginatedListDataTable
PaginatedListDataTable
A wrapper around the DataTable component, which automatically configures functionality common to
list queries that implement the PaginatedList interface, which is the common way of representing lists
of data in Vendure.
Given a GraphQL query document node, the component will automatically configure the required columns with sorting & filtering functionality.
The automatic features can be further customized and enhanced using the many options available in the props.
Example
Parameters
props
Readonly<PaginatedListDataTableProps<T, U, V, AC>>PaginatedListDataTableProps
Props to configure the PaginatedListDataTable component.
listQuery
TdeleteMutation
TypedDocumentNode<any, any>transformQueryKey
(queryKey: any[]) => any[]transformVariables
(variables: V) => VcustomizeColumns
CustomizeColumnConfig<T>additionalColumns
ACdefaultColumnOrder
(keyof ListQueryFields<T> | keyof AC | CustomFieldKeysOfItem<ListQueryFields<T>>)[]defaultVisibility
Partial<Record<AllItemFieldKeys<T>, boolean>>onSearchTermChange
(searchTerm: string) => NonNullable<V['options']>['filter']Called whenever the debounced search term changes (including when it
becomes empty). Return a partial filter to merge with the column /
faceted filters. The returned filter is only applied when the term is
non-empty — when the term is '', the returned value is discarded so
that callers can write { field: { contains: searchTerm } } without
producing tautological contains: '' clauses. The callback itself is
still invoked on every change so pages can use it as a state-sync hook.
page
numberitemsPerPage
numbersorting
SortingStatecolumnFilters
ColumnFiltersStateonPageChange
(table: Table<any>, page: number, perPage: number) => voidonSortChange
(table: Table<any>, sorting: SortingState) => voidonFilterChange
(table: Table<any>, filters: ColumnFiltersState) => voidonColumnVisibilityChange
(table: Table<any>, columnVisibility: VisibilityState) => voidfacetedFilters
FacetedFilterConfig<T>rowActions
RowAction<PaginatedListItemFields<T>>[]bulkActions
BulkActionsInputdisableViewOptions
booleantransformData
(data: PaginatedListItemFields<T>[]) => PaginatedListItemFields<T>[]setTableOptions
(table: TableOptions<any>) => TableOptions<any>registerRefresher
PaginatedListRefresherRegisterFnonReorder
( oldIndex: number, newIndex: number, item: PaginatedListItemFields<T>, ) => void | Promise<void>Callback when items are reordered via drag and drop. When provided, enables drag-and-drop functionality.
disableDragAndDrop
booleanWhen true, drag and drop will be disabled. This will only have an effect if the onReorder prop is also set
includeSelectionColumn
booleantrueWhen false, the row selection checkbox column will not be included.