DataTable API
import { DataTable } from '@editora/ui-react';
Props
| Prop | Type | Description |
|---|---|---|
bordered | boolean | |
bulkActionsLabel | string | |
bulkClearLabel | string | |
children | React.ReactNode | |
columnOrder | string | |
compact | boolean | |
draggableColumns | boolean | |
elevation | 'default' | 'none' | 'low' | 'high' | |
emptyText | string | |
filterColumn | string | number | |
filterQuery | string | |
filterRules | DataTableFilterRule[] | |
headless | boolean | |
hiddenColumns | Array<string | number> | Columns to hide, by key (data-key or header text) or 0-based index. |
hideSummary | boolean | |
hover | boolean | |
layout | 'fixed' | 'auto' | auto: columns take the width their content needs instead of an equal share (the default, fixed). Ignored with resizable columns or virtualized rows, which need fixed widths. |
loading | boolean | |
multiSelect | boolean | |
onBulkClear | (detail: DataTableBulkClearDetail) => void | |
onColumnOrderChange | (detail: DataTableColumnOrderChangeDetail) => void | |
onColumnResize | (detail: DataTableColumnResizeDetail) => void | |
onFilterChange | (detail: DataTableFilterChangeDetail) => void | |
onNavigate | (detail: DataTableRowNavigateDetail) => void | Runs before a row link (<tr data-href>) is followed. Call detail.preventDefault() to route it yourself; a surrounding NavigationProvider does this for every component at once. |
onPageChange | (detail: DataTablePageChangeDetail) => void | |
onRowSelect | (detail: DataTableRowSelectDetail) => void | |
onSortChange | (detail: DataTableSortChangeDetail) => void | |
onVirtualRangeChange | (detail: DataTableVirtualRangeChangeDetail) => void | |
overscan | number | |
page | number | |
pageSize | number | |
paginationId | string | |
pinColumns | string | { left?: Array<string | number>; right?: Array<string | number> } | |
resizableColumns | boolean | |
rowHeight | number | |
selectable | boolean | |
serverSide | boolean | The rows passed in are the current page, already sorted and filtered by the server: the table shows them as they are and still reports sort, filter and page changes for you to fetch the next set. Use with totalRows. |
shape | 'default' | 'square' | 'soft' | |
sortable | boolean | |
state | DataTableState | |
stateText | string | |
stickyFooter | boolean | |
stickyHeader | boolean | |
striped | boolean | |
totalRows | number | With serverSide: the number of rows in the whole result, for the summary and paging. |
variant | 'default' | 'flat' | 'contrast' | |
virtualize | boolean |
Also accepts the standard HTML and React props of the element it renders (className, style, id, aria-*, data-*, event handlers).
Element: <ui-data-table>
DataTable renders the ui-data-table custom element from @editora/ui-core, which can also be used without React.
Attributes: bordered, bulk-actions-label, bulk-clear-label, column-order, compact, draggable-columns, elevation, empty-text, filter-column, filter-query, filters, headless, hidden-columns, hide-summary, hover, loading, multi-select, overscan, page, page-size, pagination-id, pin-columns, resizable-columns, row-height, selectable, server-side, shape, sortable, state, state-text, sticky-footer, sticky-header, striped, total-rows, variant, virtualize
Events: bulk-clear, column-order-change, column-resize, filter-change, page-change, row-select, sort-change, virtual-range-change