Skip to content

AgGrid Table

The AgGrid table component wraps Ag Grid so you can drop a fully-featured data grid into an Orvanta app: sortable and filterable columns, inline cell editing, row selection, and row-level actions, without writing any grid boilerplate yourself.

PropertyTypeConnectableTemplatableDefaultDescription
DataArray<Object>truefalseThe table data, which can be static or dynamic through eval functions or inline scripts
[
{
"id": 1,
"name": "John Doe",
"age": 25
},
{
"id": 2,
"name": "Jane Doe",
"age": 30
}
]
export async function main() {
const res = await fetch('https://api.sampleapis.com/recipes/recipes', {
headers: { 'Content-Type': 'application/json' }
});
return res.json();
}

Two frontend script helpers give scripted control over the grid at runtime:

  • getAgGrid(id): Returns the underlying ag-grid instance for the table, for calling the ag-grid API directly.
  • setSelectedIndex(id, index): Programmatically selects a row by index.

You can attach row-level actions to an AgGrid table by dropping these components into its actions slot:

  • Button
  • Toggle
  • Select
NameTypeConnectableTemplatableDefaultDescription
Column DefsobjecttruefalseId, Name, AgeColumn definitions and names
FlexbooleanfalsefalsetrueDistributes available space among elements
All EditablebooleanfalsefalsefalseMakes all columns editable
Multiple SelectablebooleanfalsefalsefalseAllows selecting multiple rows
Row Multiselect With ClickbooleanfalsefalsetrueEnables multiselect via clicking
PaginationbooleanfalsefalsefalseEnables table pagination
Select First Row By DefaultbooleanfalsefalsefalseAuto-selects the first row
Extra Configobjecttruefalse{}Additional AgGrid configuration
CompactnessselecttruefalsenormalRow height options: normal, compact, comfortable
Wrap ActionsbooleanfalsefalsefalseWraps actions in the table
FooterbooleanfalsefalsefalseShows the table footer
Custom Actions HeaderstringtruefalseCustom header for actions
NameTypeDescription
resultobjectThe AgGrid table data
loadingbooleanLoading state
selectedRowobjectThe selected row
selectedRowIndexnumberThe selected row index
selectedRowsarrayAll selected rows
pagenumberCurrent page number
newChangesobjectLatest updated row
readybooleanComponent readiness state
inputsobjectAction outputs organized by action ID
filtersobjectApplied filters
displayRowCountnumberNumber of rows displayed

Column objects support these properties:

PropertyTypeDescription
fieldstringField name to display
headerNamestringDisplay name (if different from field)
editablebooleanAllows user editing
minWidthnumberMinimum column width
flexnumberAllocates remaining space based on flex value
hidebooleanHides the column
valueFormatterstringFormats values (currencies, dates, percentages, etc.)
sortstringSort order: asc or desc
filterbooleanEnables column filtering
cellRendererTypestringCell renderer type (link, image, button, etc.)

For datasets too large to load in one go, use the AgGrid Infinite Table variant instead. Rather than binding to a static array, it calls a runnable per page of rows and passes it five managed fields the runnable can consume as parameters:

  • $1 (limit): Rows per fetch
  • $2 (offset): Rows to skip
  • $3 (search): Current value of the grid’s search bar
  • orderBy: Column to sort by
  • isDesc: Sort direction
SELECT * FROM products
WHERE title ILIKE '%' || $3 || '%'
LIMIT $1::INT OFFSET $2::INT;

On Enterprise-tier workspaces, both table types are also available as Enterprise variants that unlock AgGrid Enterprise capabilities (e.g. row grouping, pivoting, and range selection):

  • AgGrid Table EE
  • AgGrid Infinite Table EE