Skip to main content

Data Table

Rocket 2.0

The Data Table component shows rows of data in columns, with search, sorting, filters, pagination and row selection. Use it to list records from a query, such as orders or users, and to act on the rows people pick.

Properties​

Property
Description
Expected Value
Table dataThe rows to show, as an array of objects, for example {{queries.getOrders.data}}.Array
Columns (empty: from the data)The columns to show and how each one is formatted, such as text, currency, date, badge or button. Leave it empty to build one column per field in the data.Array
Row id fieldThe field that identifies each row. The table uses it to keep the same records selected when the data reloads.Text. Default: id
PaginationSplits the rows into pages with page controls in the footer.On or off. Default: On
Rows per pageHow many rows each page shows.Number. Default: 10
Server-side pagination (data is one page)Treats Table data as one page at a time. Use the Page changed event and the pageIndex value to fetch each page from the query.On or off. Default: Off
Total records (server-side)The total number of rows across all pages when pagination is server-side. The table uses it for the page count and the row count.Number. Default: 0
Previous page enabled (server-side)Turns the previous page button on or off when pagination is server-side.On or off. Default: On
Next page enabled (server-side)Turns the next page button on or off when pagination is server-side.On or off. Default: On
Search boxShows a search box above the table that matches text in the visible columns.On or off. Default: On
Search placeholderHint text shown in the empty search box.Text. Default: Search…
Filter button textText on the filter button.Text. Default: Filter
Columns button textText on the button that lets users show or hide columns.Text. Default: Columns
Row count textText for the row count in the footer. {count} is replaced by the number of rows.Text. Default: {count} rows
No matching rows messageMessage shown when a search or filter matches no rows.Text. Default: No matching rows.
Server-side searchLeaves searching to the query: the table stops filtering rows itself and only reports the text in searchText.On or off. Default: Off
Column sortingLets users sort by a column by clicking its header. Each click cycles through ascending, descending and no sort.On or off. Default: On
Server-side sortLeaves sorting to the query: the table stops reordering rows itself and only reports the sort in sortApplied.On or off. Default: Off
Filter buttonShows the filter button, where users add conditions on columns.On or off. Default: On
Server-side filtersLeaves filtering to the query: the table stops filtering rows itself and only reports the conditions in filters.On or off. Default: Off
Row selectionLets users select a row by clicking it.On or off. Default: On
Bulk selection (checkboxes)Adds a checkbox to each row and to the header so users can select several rows at once.On or off. Default: Off
Highlight selected rowShades the selected row so it stands out.On or off. Default: On
Keep a row selected (no deselect)Keeps a row selected when the user clicks it again. Turn it off to let a second click clear the selection.On or off. Default: On
Default selected row ({ key: value })The row selected when the data loads, matched by one field and value, for example { id: 1 }.Object
Hide column chooserHides the button that lets users show or hide columns.On or off. Default: Off
Download buttonShows a download button that saves the current rows, after search, filters and sorting, as a CSV or JSON file.On or off. Default: Off
Refresh buttonShows a refresh button that fires the Refresh event, to rerun the query that fills the table.On or off. Default: Off
Row count in the footerShows the number of rows in the footer.On or off. Default: On
Row heightHeight of each row.Condensed, Regular, Spacious. Default: Regular
RowsRow style. Striped shades every other row; Bordered draws lines between cells.Regular, Striped, Bordered. Default: Regular
Sticky header (scrolls inside)Keeps the column headers in view while the rows scroll.On or off. Default: On
Currency (currency columns)Currency code used by currency columns that don't set their own, for example USD or EUR.Text. Default: USD
Number localeLocale used to format numbers and currency in columns that don't set their own, for example en-US or de-DE.Text. Default: en-US
Date format (date columns)Format used by date columns that don't set their own, for example DD MMM YYYY.Text. Default: DD MMM YYYY
Badge colours by valueColors for badge columns by cell value, for example { Paid: '#16a34a', Overdue: '#dc2626' }. A column's own colors take priority.Object
Empty messageMessage shown when the table has no rows.Text. Default: No results.
Empty descriptionA second line under the empty message.Text
Loading lookWhat the table shows while it is loading: a spinner or skeleton rows.Spinner, Skeleton. Default: Spinner

Additional Actions​

Each of these can be switched on or off, or set with a logical expression by clicking fx.

Property
Description
Expected Value
VisibilityShows or hides the component. Hidden components keep their space unless Collapse when hidden is on.On or off. Default: On
Collapse when hiddenRemoves the hidden component's space, so the components below it move up.On or off. Default: Off
Loading stateShows the component's loading look and blocks interaction, for example while a query runs.On or off. Default: Off
DisableStops the user from interacting with the component.On or off. Default: Off
Dynamic heightLets the component grow with its content in the running app instead of keeping a fixed height.On or off. Default: Off

Devices​

Property
Description
Expected Value
Show on desktopShows the component in the desktop layout.On or off. Default: On
Show on mobileShows the component in the mobile layout.On or off. Default: Off

Events​

Add a handler from the Events section of the properties panel. See Event Triggers for the steps.

Event
Description
Row clickedTriggers when the user clicks a row.
Selection changedTriggers when the selected rows change, from a click, a checkbox or a selection action.
Action button clickedTriggers when the user clicks a button in a button column. The row the button is on is selected first.
SearchTriggers when the search text changes, shortly after the user stops typing.
Sort appliedTriggers when the sort changes, from a header click or the Set sort action.
Filter changedTriggers when the filters change, from the filter button or a filter action.
Page changedTriggers when the user moves to another page or Set page changes the page.
RefreshTriggers when the user clicks the refresh button.
Row hoveredTriggers when the pointer moves onto a row.
Header clickedTriggers when the user clicks a column header.
Table data downloadedTriggers when the table data is downloaded, from the download button or the Download table data action.

Component Specific Actions (CSA)​

Run these from an event handler with Control Component, or from a RunJS query. See Component Specific Actions.

Action
Description
How To Access
Set pageMoves to the page given in Page (1-based).components.datatable1.setPage("{{1}}")
Select rowSelects the first row whose Key field equals Value.components.datatable1.selectRow("id", "")
Deselect rowClears the row selection.components.datatable1.deselectRow()
Select rowsSelects the rows whose Key field matches any of Values. With bulk selection off, only the first match is selected.components.datatable1.selectRows("id", "{{[]}}")
Deselect rowsDeselects the rows whose Key field matches any of Values.components.datatable1.deselectRows("id", "{{[]}}")
Select all rowsSelects every row that matches the current search and filters. It works only when Bulk selection (checkboxes) is on.components.datatable1.selectAllRows()
Deselect all rowsClears the row selection.components.datatable1.deselectAllRows()
Set filtersReplaces the filters with the list in Filters, for example [{ column: 'status', condition: 'equals', value: 'Paid' }], and returns to the first page.components.datatable1.setFilters("{{[{ column: 'status', condition: 'equals', value: 'Paid' }]}}")
Clear filtersRemoves all filters.components.datatable1.clearFilters()
Set sortSorts by the column in Column key, in the Direction asc or desc. Any other direction removes the sort.components.datatable1.setSort("", "asc")
Set search textSets the search text and searches the table.components.datatable1.setSearchText("")
Download table dataDownloads the current rows as a CSV or JSON file, depending on Type (csv or json).components.datatable1.downloadTableData("csv")
Set visibilityShows the component when true, hides it when false.components.datatable1.setVisibility(false)
Set disableDisables the component when true, enables it when false.components.datatable1.setDisable(false)
Set loadingTurns the loading state on with true, off with false.components.datatable1.setLoading(false)

Exposed Variables​

Variable
Description
How To Access
dataThe rows to show, as an array of objects, for example {{queries.getOrders.data}}.{{components.datatable1.data}}
columnsThe columns to show and how each one is formatted, such as text, currency, date, badge or button. Leave it empty to build one column per field in the data.{{components.datatable1.columns}}
idFieldThe field that identifies each row. The table uses it to keep the same records selected when the data reloads.{{components.datatable1.idField}}
enablePaginationSplits the rows into pages with page controls in the footer.{{components.datatable1.enablePagination}}
rowsPerPageHow many rows each page shows.{{components.datatable1.rowsPerPage}}
serverSidePaginationTreats Table data as one page at a time. Use the Page changed event and the pageIndex value to fetch each page from the query.{{components.datatable1.serverSidePagination}}
totalRecordsThe total number of rows across all pages when pagination is server-side. The table uses it for the page count and the row count.{{components.datatable1.totalRecords}}
enablePrevButtonTurns the previous page button on or off when pagination is server-side.{{components.datatable1.enablePrevButton}}
enableNextButtonTurns the next page button on or off when pagination is server-side.{{components.datatable1.enableNextButton}}
displaySearchBoxShows a search box above the table that matches text in the visible columns.{{components.datatable1.displaySearchBox}}
searchPlaceholderHint text shown in the empty search box.{{components.datatable1.searchPlaceholder}}
filterLabelText on the filter button.{{components.datatable1.filterLabel}}
columnsLabelText on the button that lets users show or hide columns.{{components.datatable1.columnsLabel}}
rowCountLabelText for the row count in the footer. {count} is replaced by the number of rows.{{components.datatable1.rowCountLabel}}
noMatchTextMessage shown when a search or filter matches no rows.{{components.datatable1.noMatchText}}
serverSideSearchLeaves searching to the query: the table stops filtering rows itself and only reports the text in searchText.{{components.datatable1.serverSideSearch}}
enabledSortLets users sort by a column by clicking its header. Each click cycles through ascending, descending and no sort.{{components.datatable1.enabledSort}}
serverSideSortLeaves sorting to the query: the table stops reordering rows itself and only reports the sort in sortApplied.{{components.datatable1.serverSideSort}}
showFilterButtonShows the filter button, where users add conditions on columns.{{components.datatable1.showFilterButton}}
serverSideFilterLeaves filtering to the query: the table stops filtering rows itself and only reports the conditions in filters.{{components.datatable1.serverSideFilter}}
allowSelectionLets users select a row by clicking it.{{components.datatable1.allowSelection}}
showBulkSelectorAdds a checkbox to each row and to the header so users can select several rows at once.{{components.datatable1.showBulkSelector}}
highlightSelectedRowShades the selected row so it stands out.{{components.datatable1.highlightSelectedRow}}
disableRowDeselectionKeeps a row selected when the user clicks it again. Turn it off to let a second click clear the selection.{{components.datatable1.disableRowDeselection}}
defaultSelectedRowThe row selected when the data loads, matched by one field and value, for example { id: 1 }.{{components.datatable1.defaultSelectedRow}}
hideColumnSelectorButtonHides the button that lets users show or hide columns.{{components.datatable1.hideColumnSelectorButton}}
showDownloadButtonShows a download button that saves the current rows, after search, filters and sorting, as a CSV or JSON file.{{components.datatable1.showDownloadButton}}
showRefreshButtonShows a refresh button that fires the Refresh event, to rerun the query that fills the table.{{components.datatable1.showRefreshButton}}
showRowCountShows the number of rows in the footer.{{components.datatable1.showRowCount}}
cellSizeHeight of each row.{{components.datatable1.cellSize}}
tableTypeRow style. Striped shades every other row; Bordered draws lines between cells.{{components.datatable1.tableType}}
stickyHeaderKeeps the column headers in view while the rows scroll.{{components.datatable1.stickyHeader}}
currencyCurrency code used by currency columns that don't set their own, for example USD or EUR.{{components.datatable1.currency}}
localeLocale used to format numbers and currency in columns that don't set their own, for example en-US or de-DE.{{components.datatable1.locale}}
dateFormatFormat used by date columns that don't set their own, for example DD MMM YYYY.{{components.datatable1.dateFormat}}
badgeColorsColors for badge columns by cell value, for example { Paid: '#16a34a', Overdue: '#dc2626' }. A column's own colors take priority.{{components.datatable1.badgeColors}}
emptyTextMessage shown when the table has no rows.{{components.datatable1.emptyText}}
emptyDescriptionA second line under the empty message.{{components.datatable1.emptyDescription}}
loadingIndicatorWhat the table shows while it is loading: a spinner or skeleton rows.{{components.datatable1.loadingIndicator}}
selectedRowThe row selected or last clicked, as an object.{{components.datatable1.selectedRow}}
selectedRowIdThe position of the selected row in Table data, starting at 0.{{components.datatable1.selectedRowId}}
selectedRowsAll selected rows, as an array of objects.{{components.datatable1.selectedRows}}
selectedRowsIdThe positions of the selected rows in Table data.{{components.datatable1.selectedRowsId}}
pageIndexThe current page number, starting at 1.{{components.datatable1.pageIndex}}
searchTextThe text in the search box.{{components.datatable1.searchText}}
sortAppliedThe current sort, as [{ column, columnKey, direction }], or an empty array.{{components.datatable1.sortApplied}}
filtersThe current filters, as an array of { column, columnKey, condition, value }.{{components.datatable1.filters}}
currentDataAll rows after search, filters and sorting, across every page.{{components.datatable1.currentData}}
currentPageDataThe rows on the current page.{{components.datatable1.currentPageData}}
filteredDataAll rows after search, filters and sorting, across every page.{{components.datatable1.filteredData}}
lastActionClickedThe last button clicked in a button column, with its buttonId, columnKey, columnName and row.{{components.datatable1.lastActionClicked}}
hoveredRowThe row under the pointer, as an object.{{components.datatable1.hoveredRow}}
hoveredRowIdThe position of the hovered row in Table data.{{components.datatable1.hoveredRowId}}
selectedColumnHeaderThe column header last clicked, with its name and key.{{components.datatable1.selectedColumnHeader}}
isVisibleWhether the component is visible.{{components.datatable1.isVisible}}
isLoadingWhether the component is in its loading state.{{components.datatable1.isLoading}}
isDisabledWhether the component is disabled.{{components.datatable1.isDisabled}}

Styles​

Style
Default
Table shadow0px 0px 0px 0px #00000040
Accent (checkboxes, focus, active page)Theme: Brand primary
Table backgroundTheme: Surface 1
Header row backgroundTheme: Surface 1
Header text colorTheme: Placeholder text
Cell text colorTheme: Primary text
Secondary text color (footer, empty state)Theme: Placeholder text
Border and row divider colorTheme: Default border
Row hover backgroundTheme: Surface 3
Selected row backgroundTheme: Brand primary
Striped row backgroundTheme: Surface 3
Table radiusβ€”
Font size (px)14
Header casingAs typed
Border around the tableOn
Box shadow0px 0px 0px 0px #00000040

A default that starts with Theme: follows the app's theme until the style is set to another value. See App Themes.