Vega Table Operations
Overview
Vega Table operations are the actions the Vega Table component performs. These actions include filtering, adding rows, removing rows, navigating to different table pages, and so on. But, instead of running operations in the Table component, you'll use logic components to control and trigger them.
Each Vega Table operation holds key/value pairs called options. For each Vega Table option, enter the relevant option value to customize how your Vega Table operation performs. For example, the TABLE_SET_COLUMN_FILTER operation filters columns in the Vega Table component. The TABLE_SET_COLUMN_FILTER operation uses the ColumnFilter option key/value pair to determine the column you want to filter by.
To control and trigger Vega Table operations in logic components, use a new Outputs Enter outputs components and actions you want the component to perform. Type called VEGA_OPERATION. For the logic component's Outputs Value, enter the operation and options you want your Vega Table to perform.
Here is the basic template for performing an operation:
{
"type": "OPERATION_TYPE",
"options": {
// Options go here.
}
}
Vega Table Operations
Below is a list of all supported Vega Table operations you can use to control your Vega Table component.
This banner denotes that the operation requires you to enable a feature flag to use it. To learn more, view the Enabling Feature Flags section of this article.
Operation Type |
Description |
Option |
Example JSON |
---|---|---|---|
TABLE_SET_COLUMN_FILTER |
Filters one or more columns. |
ColumnFilter = { id: string value: unknown } |
Copy
|
TABLE_SET_GLOBAL_FILTER |
Filters all columns simultaneously. |
|
Copy
|
TABLE_GO_TO_FIRST_PAGE |
Navigates to the first page of the table. |
Use enablePagination: true to allow pagination. |
Copy
|
TABLE_GO_TO_LAST_PAGE |
Navigates to the last page of the table. |
Use enablePagination: true to allow pagination. |
Copy
|
TABLE_GO_TO_NEXT_PAGE |
Navigates to the next page of the table. |
Use enablePagination: true to allow pagination. |
Copy
|
TABLE_GO_TO_PAGE |
Navigates to a specific page of the table. |
The first page has an index of 0. Use enablePagination: true to allow pagination. |
Copy
Copy
|
TABLE_GO_TO_PREVIOUS_PAGE |
Navigates to the previous page of the table. |
Use enablePagination: true to allow pagination. |
Copy
|
TABLE_SET_PAGE_SIZE |
Sets the number of rows displayed on each page. |
Use enablePagination: true to allow pagination. |
Copy
Copy
|
TABLE_ADD_COLUMN |
Adds a column to the table. |
You can add additional definitions, like label. If you do not provide label, it defaults to the label associated with the type of component. |
Copy
|
TABLE_REMOVE_COLUMN |
Removes a column from the table. |
|
Copy
|
TABLE_SET_SELECTED_ROW |
Highlights the selected row of the table. |
RowSelection = {[rowIndex: string]: boolean} Use enableRowSelection: true to allow row selection. |
Copy
|
TABLE_SET_GROUPING_CRITERIA |
Sets row grouping in the table. |
Use enableGrouping: true to allow row grouping. |
Copy
|
TABLE_TOGGLE_GROUPING |
Enables or disables grouping. |
|
Copy
|
TABLE_SET_ROW_PINNING |
Pins a row of the table. |
RowPinningState = { top: string[] bottom: string[] } Use enableRowPinning: true to allow row pinning. |
Copy
|
TABLE_SET_COLUMN_VISIBILITY |
Displays or hides a column of the table. |
|
Copy
|
TABLE_SET_COLUMN_PINNING |
Pins a column of the table. |
ColumnPinningState = { left: string[] right: string[] } |
Copy
|
TABLE_CLEAR |
Removes all columns and rows from the table. |
|
Copy
|
Adds an empty row to the table at a specified index. |
If no index is specified, a row adds to the bottom of the table. |
Copy
|
|
TABLE_REMOVE_ROWS |
Removes a specified row(s) from the table. |
The target key of the row(s) to be removed.
The index for the row(s) to be removed. |
Copy
|
TABLE_SET_ACTION_TOOLBAR_VISIBILITY |
Displays or hides the action toolbar. |
|
Copy
|
TABLE_SET_COLUMN_FILTERS_VISIBILITY |
Displays or hides the column filter toolbar. |
|
Copy
|
TABLE_SET_GLOBAL_FILTER_VISIBILITY |
Displays or hides the global filter toolbar. |
|
Copy
|
Enabling Feature Flags
Many of the Vega Table operations require you to enable them in your Initializer component. The table below provides you with the necessary syntax to enable pagination, row selection, grouping, and pinning.
Operation Type |
Description |
Option | Example JSON |
---|---|---|---|
SET_PROPERTY |
Enables those operations behind a feature flag. |
|
Copy
|
It's important to note that you can enable feature flags and perform Vega Table operations in the same Initializer component.
Resources