The Table component for Retool Apps
A table to display data that can be sorted, filtered, paginated, and edited.
Table renders an array of data, such as database records, as a tabulated list. Refer to the working with tables guide to learn more about using the Table component.
Settings
Table includes the following configurable options when building apps in the IDE.
Properties
All properties for Table with supported data types or values. You can write JavaScript almost anywhere in Retool to manipulate or read property values.
autoColumnWidth
Whether to automatically set column widths.
caseSensitiveFiltering
Whether to perform case-sensitive filtering.
changesetArray
A list of rows, by index, with edited values and primary key when the table is configured with a Primary key column.
disableEdits
Whether to disable editing of values.
disableSave
Whether to disable saving changes for edited values.
emptyMessage
The message to display if no value is set.
filterStack
A list of filters that apply and the operator to which they evaluate.
Properties
global
Whether the object is globally scoped for use in all app pages.
groupByColumns
A list of columns by which the Table is grouped.
heightType
Whether the height automatically resizes to fit content or is a fixed size.
Values
Whether the component is visible.
id
The unique identifier.
isHiddenOnDesktop
Whether the component is visible in the desktop layout.
isHiddenOnMobile
Whether the component is visible in the mobile layout.
maintainSpaceWhenHidden
Whether the component takes up space on the canvas if hidden
is true
.
newRows
A list of newly added rows. Each new row is an object with an entry for each edited value.
overflowActionsOverlayMaxHeight
The maximum height of the overflow actions overlay.
overflowActionsOverlayMinWidth
The minimum width of the overflow actions overlay.
overflowType
The overflow behavior when the contents exceeds the height.
Values
pagination
The pagination state.
Properties
pluginType
The plugin type.
searchMode
The type of search to perform.
Values
searchTerm
An optional string to filter the displayed options. Matches values or labels if provided.
selectedDataIndex
The source data row index that corresponds to the selected row. If multiple row selection is enabled, the data of the most recently selected row.
selectedDataIndexes
The source data row indexes that corresponds to the selected rows.
selectedRow
The selected row. If rowSelection
is multiple
, the most recently selected row.
selectedRowKey
The selected row, by key, when the table is configured with a Primary key column.
selectedRowKeys
A list of selected rows, by key, when the table is configured with a Primary key column.
selectedRows
A list of selected rows, by index.
selectedSourceRow
The selected source row. If rowSelection
is multiple
, the most recently selected source row. Excludes mapped values or custom columns that are not present in the source data.
selectedSourceRows
A list of selected source rows, by index. Excludes mapped values or custom columns that are not present in the source data.
showInEditor
Whether to remain visible in the editor if hidden
is true
.
sortArray
A list of column IDs and sort direction.
Properties
Methods
JavaScript API methods for interacting with Table. You can write JavaScript almost anywhere in Retool and use methods to manipulate data and property values.
clearChangeset
Clear changesetArray
, changesetObject
, and newRows
values.
table.clearChangeset()
clearFilter
Clear the filter with the specified ID.
table.clearFilter(id)
Parameters
clearFilterStack
Clears all filters. To reset to the default filters, use resetFilterStack() instead.
table.clearFilterStack()
clearSelection
Clear the currently selected rows.
table.clearSelection()
clearSort
Clear the current sorting options.
table.clearSort()
collapseRows
Collapse rows with the specified indexes.
table.collapseRows()
expandRows
Expands rows with the specified indexes.
table.expandRows()
exportData
Exports table data as a file in a CSV, TSV, JSON, or Excel format.
table.exportData(exportDataOptions)
Parameters
getDisplayedData
Returns the currently displayed data in Table. Respects filtering and sorting.
table.getDisplayedData()
refresh
Trigger all queries from which the component sources data.
table.refresh()
resetFilterStack
Resets the Table to its default filters. To clear all filters, use clearFilterStack() instead.
table.resetFilterStack()
scrollIntoView
Scrolls the canvas or parent container so that the selected component appears in the visible area.
table.scrollIntoView(scrollIntoViewOptions)
Parameters
scrollToRow
Scrolls to a specific row.
table.scrollToRow()
selectNextRow
Select the next row.
table.selectNextRow()
selectPreviousRow
Select the previous row.
table.selectPreviousRow()
selectRow
Selects a specific row.
table.selectRow()
setFilter
Add a filter to the current filter stack. Updates an existing filter if a corresponding ID is provided.
table.setFilter(filters)
Parameters
setFilterStack
Sets filters and operator to apply to the table.
table.setFilterStack(filterStack)
Parameters
setGrouping
Set the columns with which the table should group. Sort direction defaults to ascending.
table.setGrouping(setGroupingOptions)
Parameters
setHidden
Set the hidden
value to toggle whether the component is visible. Defaults to true
without a parameter.
table.setHidden(hidden)
Parameters
setPage
Set the current page.
table.setPage(page)
Parameters
setSort
Sort rows by the specified column and direction. Optionally provide an array of objects to sort by multiple columns
table.setSort(sortArray)
Parameters
updateLinkedFilter
Update the value of the linked Filter component.
table.updateLinkedFilter(filterStack)
Parameters
Events
Events are triggered by user interactions, such as clicking a button or entering a value. Use event handlers to trigger queries or other actions in response to events.
blur
The input field is blurred.
cancel
An action is canceled.
change
The value is changed.
changeCell
The value of a cell is changed.
changeFilter
A filter is changed.
changePage
The page is changed.
changeRowSelection
A selected row is changed.
changeSort
The sorting option is changed.
clickAction
An action button is clicked or pressed.
clickCell
A cell is clicked or pressed.
clickRow
A row is clicked or pressed.
clickToolbar
A toolbar item is clicked or pressed.
deselectRow
A selected row is deselected.
doubleClickRow
A row is double-clicked.
expandRow
A row is expanded.
focus
The input field is focused.
save
Changes are saved.
selectCell
A cell is selected.
selectRow
A row is selected.