ProGridSign in

Guides

Migrating from AG Grid to ProGrid

Most AG Grid column definitions map one-to-one onto ProGrid column metadata, and the transaction API keeps its names. This guide walks through the mapping, the parts that differ, and a screen-by-screen migration order.

What changes, and what does not

ProGrid is built on TanStack Table, so a column is a TanStack ColumnDef with a meta block rather than an AG Grid ColDef. The concepts you configured in AG Grid — filters by type, groupable and pivotable dimensions, aggregated measures, formatters, pinning, server-side data, row transactions — all exist, usually under a shorter name. What you lose is the class-based API surface (gridApi, columnApi, modules, licence keys); what you gain is a component whose entire state is a plain object you can read, control and persist.

Column definitions

The same two columns in both grids. Everything AG Grid put on the ColDef moves into meta.

// AG Grid
const columnDefs = [
  { field: "region", headerName: "Region", filter: "agSetColumnFilter", enableRowGroup: true, enablePivot: true },
  { field: "revenue", headerName: "Revenue", filter: "agNumberColumnFilter", enableValue: true, aggFunc: "sum",
    valueFormatter: (p) => formatMoney(p.value), type: "rightAligned" },
]
// ProGrid — a TanStack ColumnDef plus a meta block
const columns: ProColumnDef<Order>[] = [
  { accessorKey: "region", header: "Region",
    meta: { type: "string", filterVariant: "set", groupable: true, pivotable: true } },
  { accessorKey: "revenue", header: "Revenue",
    meta: { type: "number", align: "right", aggregable: true, defaultAgg: "sum", formatValue: formatMoney } },
]
Column definition mapping
AG Grid ColDefProGridNotes
fieldaccessorKeyNested paths use accessorFn, as in TanStack Table.
headerNameheaderA string or a render function.
filter: 'agTextColumnFilter'meta.type: 'string'The type picks the editor and operators.
filter: 'agNumberColumnFilter'meta.type: 'number'
filter: 'agDateColumnFilter'meta.type: 'date'dateGranularity chooses day or instant.
filter: 'agSetColumnFilter'meta.filterVariant: 'set'Add filterOptions to fix the list and its labels.
filter: falsemeta.filterable: false
enableRowGroupmeta.groupable
enablePivotmeta.pivotable
enableValue + aggFuncmeta.aggregable + meta.defaultAggsum, avg, min, max, count and more.
valueFormattermeta.formatValueApplied to cells, aggregates, pivot cells and chart axes.
cellRenderercellTanStack's cell render function.
cellClass / cellStylemeta.cellClassName / meta.cellStyle
type: 'rightAligned'meta.align: 'right'Numbers right-align by default.
pinned: 'left'initialState.columnPinning.leftPinning is grid state, not a column attribute.
width / minWidthsize / minSizeTanStack sizing.
hideinitialState.columnVisibility
headerTooltipmeta.tooltip

Grid options

Grid option mapping
AG GridProGridNotes
rowDatadata
getRowIdgetRowIdSame purpose; required for live updates and stable selection.
rowSelection: 'multiple' + checkboxSelectionrowSelection (default on)A checkbox column is the default; set false to remove it.
enableRangeSelectioncellSelection (default on)Drag a rectangle, copy as TSV.
pagination + paginationPageSizepagination={{ mode: 'pages', pageSize }}Or mode: 'infinite'.
quickFilterTexttoolbar.quickFilter / ref.setQuickFilterThe toolbar owns the search box.
rowGroupPanelShowtoolbar.groups
pivotModeinitialPivot / ref.setPivotModeThe pivot field panel replaces the columns tool panel.
sideBar (columns)toolbar.columnsThe column chooser popover.
masterDetail + detailCellRendererrenderDetail + getRowCanExpand
onRowClicked / onRowDoubleClickedonRowClick / onRowDoubleClick
localeTextlocale='pt'Built-in message tables; see i18n.
rowHeightrowHeightAlso seeds the row virtualizer's estimate.
domLayout: 'autoHeight'maxHeight
suppressColumnVirtualisationcolumnVirtualization={false}On by default above 20 visible columns.
api.getColumnState() / applyColumnState()ref.getState() / state prop / persistOne state object covers layout, sort, filters, grouping, pivot and paging.
enableCellChangeFlashliveUpdates.flashOn whenever liveUpdates is on.

Server-side data

AG Grid’s server-side row model asks for a block of rows through a getRows callback and expects you to call success or fail. ProGrid asks for a page through an async function and hands you an AbortSignal for the request it replaces.

// AG Grid server-side row model
gridOptions.serverSideDatasource = {
  getRows(params) {
    const { startRow, endRow, sortModel, filterModel } = params.request
    fetch(`/api/orders?${toQuery(startRow, endRow, sortModel, filterModel)}`)
      .then((r) => r.json())
      .then(({ rows, total }) => params.success({ rowData: rows, rowCount: total }))
      .catch(() => params.fail())
  },
}
// ProGrid — one function, one query object, cancellation included
<ProGrid
  columns={columns}
  dataSource={async (query, signal) => {
    const res = await fetch(`/api/orders?${toSearchParams(query)}`, { signal })
    const { rows, total } = await res.json()
    return { rows, total }
  }}
  pagination={{ mode: "pages", pageSize: 50 }}
/>

filterModel becomes query.filters, a flat list of { id, type, conditions, join } objects that createRestDataSource can serialise for you. If your API only supports some operators, pass serverOperators and the filter editors offer nothing the backend cannot answer. The full contract is on the server-side data page.

Row transactions

applyTransaction and applyTransactionAsync keep their names and their add / update / remove shape. Two differences: you opt in with the liveUpdates prop, and the seed rows must stay referentially stable — a new data array is treated as authoritative and discards applied transactions.

// The names are the same. ProGrid needs liveUpdates and a data-derived getRowId.
<ProGrid ref={grid} columns={columns} data={seed} getRowId={(o) => o.id} liveUpdates />

grid.current.applyTransaction({ update: [changed], add: [created], remove: ["ORD-1"] })
grid.current.applyTransactionAsync({ update: batch })   // coalesced, like AG Grid's

Things that do not map

  • Cell editing. ProGrid is a read, analyse and select grid. If a screen relies on AG Grid’s inline editors, keep that screen on AG Grid or render your own editor in a detail panel.
  • Tree data (treeData) and row spanning. Grouping builds hierarchy from flat rows; a pre-nested tree is not an input shape.
  • Integrated charts. ProGrid charts the grouped or pivoted result through Recharts, from the chart dialog or the context menu. There is no chart-per-range API.
  • Modules and the licence manager. There is nothing to register. Import the component and its stylesheet.

Migration order

  • Start with a read-only screen that groups or pivots — that is where ProGrid’s defaults do the most work for you.
  • Translate its column definitions with the table above; keep the TanStack column ids equal to your old field names so saved filters carry over.
  • Move the screen’s grid state out of getColumnState into persist with a key, or into a controlled state prop.
  • Wire server screens through dataSource, then delete the getRows plumbing.
  • Run both grids side by side behind a flag until the numbers in the footer agree, then remove AG Grid’s modules and the licence key.

The ProGrid vs AG Grid comparison lists the feature and licensing differences in one table if you are still deciding.