Table Actions
Table actions are user interactions that either modify local state (Edit Row Mode) or trigger backend events (Data Mode).
Edit Row Mode
| Action | Description |
|---|---|
| Add button | Visible when Hide Add Button is not checked. Clicking the button creates a new empty row in the table. No event is sent to the backend. |
Data Mode
In Data Mode, user interactions trigger runFormEvent from FormHostProvider and send a named event to the backend. The backend uses the widgetName and widgetEvent properties on the incoming request to identify the event and respond appropriately.
| Action | Event Sent | Notes |
|---|---|---|
| Add button | onTableCreateRecordEvent | Visible when Hide Add Button is not checked. The backend should respond using the OpenModal response structure to display an appropriate form. |
| Top bar "Download" button | onTableRunBatchActionEvent | Visible when one or more rows are selected. Requires Row Selection to be enabled. |
| Top bar "Delete" button | onTableRunBatchActionEvent | Visible when one or more rows are selected. Requires Row Selection to be enabled. |
| Row action (menu or flat) | onTableRunActionEvent | Visible when at least one option is selected under Row Actions in the widget properties. |
| Table load / Pagination controls | onTableLoadData | Fired on initial table load and whenever the user interacts with any pagination control (rows per page, page number, next/previous). |
Event Details
onTableCreateRecordEvent
Fired when the user clicks the Add button in Data Mode.
The backend should:
- Detect the event via
widgetEvent === "onTableCreateRecordEvent" - Return an
OpenModalresponse to display a form for creating a new record - After the user saves the modal form, refresh the table data
onTableRunBatchActionEvent
Fired when the user clicks Download or Delete from the top toolbar after selecting one or more rows.
The request payload contains the IDs (or row data) of all selected rows. The backend should:
- Identify the action type from the request
- Process all selected rows accordingly
- Return an appropriate response (e.g., refresh table or return a file download)
onTableRunActionEvent
Fired when the user selects a row-level action from the row action menu or flat buttons.
The request payload contains the data of the target row. The backend should:
- Identify which action was selected
- Process the row accordingly (e.g., open a detail form, trigger a workflow)
onTableLoadData
Fired on initial table load and whenever the user interacts with a pagination control (rows per page, page number, next/previous).
The request payload contains table metadata including:
rowsPerPage— number of rows requestednextToken— continuation token from the previous response (empty string on first load)- Current filter and sort state
The backend should return the requested page of data along with updated tableMeta. See the Pagination Guide for full backend implementation examples.