Skip to main content
Version: 3.1.0-Beta 🚧

Component Specific Actions (CSA) and Exposed Variables

Component specific actions (CSA)

The following actions of the Table component can be controlled using the component specific actions(CSA):

Action
Description
How To Access
setPage()Sets the page on the table.Employ a RunJS query (for e.g.,
await components.table1.setPage(2))
or trigger it using an event.
selectRow()Selects a row on the tableEmploy a RunJS query (for e.g.,
await components.table1.selectRow('id','11'))
or trigger it using an event.
deselectRow()Deselects a row on the table.Employ a RunJS query (for e.g.,
await components.table1.deselectRow())
or trigger it using an event.
selectAllRows()Selects all rows on the table.Employ a RunJS query (for e.g.,
await components.table1.selectAllRows())
or trigger it using an event.
deselectAllRows()Deselects all rows on the tableEmploy a RunJS query (for e.g.,
await components.table1.deselectAllRows())
or trigger it using an event.
discardChanges()Discards the changes from the table when a cell is edited.Employ a RunJS query (for e.g.,
await components.table1.discardChanges())
or trigger it using an event.
discardNewlyAddedRows()Discards the newly added rows from the add new row popup on the table.Employ a RunJS query (for e.g.,
await components.table1.discardNewlyAddedRows())
or trigger it using an event.
downloadTableData()Retrieves the data from the table in the PDF, CSV, or Excel sheet.Employ a RunJS query (for e.g.,
await components.table1.downloadTableData('pdf'))
or trigger it using an event.
setFilters()Applies filters to the table data.Employ a RunJS query (for e.g.,
await components.table1.setFilters ([{column:'name',condition:'contains',value: 'Sarah'}]))
or trigger it using an event.
clearFilters()Removes all applied filters from the table.Employ a RunJS query (for e.g.,
await components.table1.clearFilters())
or trigger it using an event.

Exposed variables

VariableDescription
currentDataData that is currently being displayed by the table (including edits if any).
currentPageDataData that is displayed on the current page if pagination is enabled (including edits if any).
pageIndexIndex of the current page, starting from 1
changeSetObject with row number as the key and object of edited fields and their values as the value.
dataUpdatesSimilar to changeSet, but dataUpdates includes data for the entire row that is being edited.
selectedRowContains the data of the row that was most recently clicked. When an action button is clicked, selectedRow is also updated. Its initial value is set to the data of the first row when the app is loaded.
selectedRowIdStores the ID of the row that was last clicked. Similar to selectedRow, it gets updated when an action button is clicked. You can access its value using {{components.table1.selectedRowId}}. By default, it is set to 0, representing the ID of the first row when the app is loaded.
selectedCellThe data of the cell that was last clicked on the table.
searchTextThe value of the search field if server-side pagination is enabled.
newRowsThe newRows variable stores an array of objects, each containing data for a row that was added to the table using the "Add new row" button. When the user clicks either the "Save" or "Discard" button in the modal, this data is cleared.

If the data in a cell is changed, changeSet property of the Table object will have the index of the row and the field that changed.

Along with changeSet, dataUpdates property will also be changed when the value of a cell changes. dataUpdates will have the whole data of the changed index from the Table data.

If the data of a cell is changed, Save changes button will be shown at the bottom of the Table. This button when clicked will trigger the Bulk update query event. This event can be used to run a query to update the data on your data source.