Data Table Node
Data tables are powerful ways to display tabular data, like what you find in a CSV or SQL database.
Override the data
property with the row-formatted data source (an array of objects with consistent keys). Often, this data is the result of a function (e.g. {{pgQuery1.data}}
).
Data tables come batteries-included with support for:
- Column controls (renaming, formatting, filtering, sorting)
- Infinite scroll and pagination
- Row selection / auto-advance
- Downloading the underlying data (coming soon)
- Custom cells (coming soon)
All data tables are virtualized and therefore remain performant when scrolling through large numbers of rows.
Properties
Visible
Prop | dataTableNode.isVisible |
---|---|
Type | boolean |
Default | {{true}} |
Whether or not this node is visible.
Enabled
Prop | dataTableNode.isEnabled |
---|---|
Type | boolean |
Default | {{true}} |
Whether or not this node is enabled.
Tooltip
Prop | dataTableNode.tooltip |
---|---|
Type | string |
Default | undefined |
The tooltip text to display when hovered or focused over this node.
Top
Prop | dataTableNode.top |
---|---|
Type | string |
Default | 1 |
The position of the node from the top side of the grid (grid-row-start
).
Left
Prop | dataTableNode.left |
---|---|
Type | string |
Default | 1 |
The position of the node from the left side of the grid (grid-column-start
).
Width
Prop | dataTableNode.width |
---|---|
Type | string |
Default | 640px |
The width of the node. When this node is in a grid layout, this should be done using unitless grid column units (specifying 4
will become grid-column-end: span 4
). When this node is in a stack layout, the width must be specified using CSS units (e.g. 100px
or 100%
).
Min Width
Prop | dataTableNode.minWidth |
---|---|
Type | string |
Default | none |
The minimum width of the node. When this node is in a grid layout, this property is ignored.
Max Width
Prop | dataTableNode.maxWidth |
---|---|
Type | string |
Default | none |
The maximum width of the node. When this node is in a grid layout, this property is ignored.
Height
Prop | dataTableNode.height |
---|---|
Type | string |
Default | 480px |
The height of the node. When this node is in a grid layout, this should be done using unitless grid row units (specifying 4
will become grid-row-end: span 4
). When this node is in a stack layout, the height must be specified using CSS units (e.g. 100px
or 100%
).
Min Height
Prop | dataTableNode.minHeight |
---|---|
Type | string |
Default | none |
The minimum height of the node. When this node is in a grid layout, this property is ignored.
Max Height
Prop | dataTableNode.maxHeight |
---|---|
Type | string |
Default | none |
The minimum height of the node. When this node is in a grid layout, this property is ignored.
Overflow
Prop | dataTableNode.overflow |
---|---|
Type | Overflow ('auto' | 'visible' | 'hidden' | 'scroll') |
Default | auto |
The strategy used to handle overflow in the horizontal and vertical axes for content that is larger than its container.
Overflow X
Prop | dataTableNode.overflowX |
---|---|
Type | Overflow ('auto' | 'visible' | 'hidden' | 'scroll') |
Default | auto |
The strategy used to handle overflow in the horizontal axis for content that is larger than its container.
Overflow Y
Prop | dataTableNode.overflowY |
---|---|
Type | Overflow ('auto' | 'visible' | 'hidden' | 'scroll') |
Default | auto |
The strategy used to handle overflow in the vertical axis for content that is larger than its container.
Custom Styles
Prop | dataTableNode.styles |
---|---|
Type | string |
Default | element.styles { } |
Custom CSS styles to be applied to the node. Use element.styles
to refer to the current node.
Data Source
Prop | dataTableNode.data |
---|---|
Type | Array<UnknownRecord> |
Default | undefined |
The table data in row-wise format. An array of objects with consistent keys, this is often the result of a function (e.g. {{pgQuery1.data}}
).
Lock Columns
Prop | dataTableNode.lockColumns |
---|---|
Type | boolean |
Default | {{false}} |
Whether or not columns are locked.
Auto Columns
Prop | dataTableNode.autoColumns |
---|---|
Type | boolean |
Default | {{true}} |
Auto generate columns when data changes
Columns
Prop | dataTableNode.columns |
---|---|
Type | Array<{ header: string, accessor: string, id: string, width: (number | string), minWidth: number, renderAs: string, dateTimeFormat: string, widthUnit: string, minWidthUnit: string, isVisible: boolean, allowSortBy: boolean }> |
Default | [] |
The column configuration for the data table.
Flatten
Prop | dataTableNode.flatten |
---|---|
Type | boolean |
Default | {{false}} |
Whether or not to flatten the data source's keys. For example, if the data table receives a deeply nested row object like [{ "foo": { "bar": "baz", "qux": "quux" }]
, it will flatten these keys to two columns named foo.bar
and foo.qux
.
Selected Row
Prop | dataTableNode.selectedRow |
---|---|
Type | unknown |
Default | undefined |
The currently selected row of the data table. This property contains the row object itself, and so can be used to access keys on the underlying object.
Selected Row Index
Prop | dataTableNode.selectedRowIndex |
---|---|
Type | number |
Default | 0 |
The currently selected row's index within the data table. This property will reflect the numeric index within the data source that is selected. 0-indexed — the first row is 0
, second row is 1
, etc.
Default First
Prop | dataTableNode.autoselectFirstRow |
---|---|
Type | boolean |
Default | {{false}} |
Whether or not to auto-select the first row of the data table upon initialization. Useful for auto-advancing through items in the data table, such as when building approval workflows.
Pagination
Prop | dataTableNode.paginationEnabled |
---|---|
Type | boolean |
Default | {{false}} |
Exposes the pagination controls for the user to bind to function calls
Fetch Limit
Prop | dataTableNode.pageSize |
---|---|
Type | number |
Default | auto |
Number of rows per Page, used to set parameters on paginated query
Fetch Offset
Prop | dataTableNode.paginationOffset |
---|---|
Type | number |
Default | 0 |
Offset to begin data query from, used to set parameters on paginated query
Current Page
Prop | dataTableNode.currentPage |
---|---|
Type | number |
Default | 1 |
Current page being displayed
Total Rows
Prop | dataTableNode.totalRowCount |
---|---|
Type | number |
Default | 0 |
Number of entries in the Data set, used to set bounds on pagination
Event Handlers
On Select Row
Handler | dataTableNode.onSelectRow |
---|
Called when the selected row changes. Use this event to trigger downstream changes