What's New
See the release post for details of what's new in version 31.
Codemods
Follow these steps to upgrade your project's AG Grid version to 31.0.0
:
Locate your project's
package.json
and note the version of AG Grid that you are currently using.Update any AG Grid dependencies listed in the
package.json
to version31.0.0
.Open a terminal and navigate to your project's root folder.
Run the
migrate
command of version31.0
of the AG Grid codemod runner, where$FROM_VERSION
refers to your project's existing AG Grid version:npx @ag-grid-devtools/cli@31.0 migrate --from=$FROM_VERSION
This will update your project's source files to prepare for the new release.
By default the Codemod runner will locate all source files within the current directory. For projects with more specific requirements, pass a list of input files to the
migrate
command, or specify the--help
argument to see more fine-grained usage instructions.
The Codemod runner will check the state of your project to ensure that you don't lose any work. If you would rather see a diff of the changes instead of applying them, pass the --dry-run
argument.
The codemod only transforms source files that make use of deprecated features, so if you aren't currently making use of any of those APIs your source code will be unaffected by the codemod.
See the Codemods documentation for more details.
Breaking Changes
This release includes the following breaking changes:
React
AgGridReactFire
is no longer exported fromag-grid-react
. You should useAgGridReact
instead.The loading overlay is now displayed for all row models if column definitions are not provided when the grid is initialised. The rows will also not be created and rendered until the column definitions are provided.
Validation is now run when
gridOptions
are updated, meaning warnings may appear in console when changing grid options if an invalid configuration is reached.Auto-generated group row IDs when using Client-Side Row Model now have a different format (but the same prefix).
rowDataUpdated
event is only fired for the Client-Side Row Model (per the existing documentation)."Legacy React Rendering, enabled via
suppressReactUi
property is deprecated since v28 and is now removed.AG Grid now only renders via React components as has been the default since v28.
rowDataChangeDetectionStrategy
- removed. identity / reference equals always used.
Integrated Charts
The solar
and pastel
integrated chart themes have been removed. Any saved chart models will be migrated to the new polychroma
and sheets
themes respectively. If you're using themeOverrides, see charts migration page as the structure and naming of options have changed.
If you are using Standalone Charts, please see changes to charts in the AG Charts Migration Guide.
ColumnDefs
- Grid columns are now sortable and resizable by default. Also, the grid animates rows by default. In order to avoid this, please set
defaultColDef.resizable = false
,defaultColDef.sortable = false
andgridOptions.animateRows = false
. - When not providing column definitions or setting
columnDefs = undefined
, a loading overlay will be displayed until column definitions are set. To go back to the earlier behavior of showing a grid without any columns, please setcolumnDefs = []
. - Setting
columnDefs
tonull
/undefined
via a call toapi.setColumnDefs
or via a state variable no longer clears the columns shown in the grid. Instead, setcolumnDefs
to[]
to clear the columns shown in the grid. useValueFormatterForExport
is now true by default. This means that cell values are formatted using the column's valueFormatter when exporting data from the grid. This applies to CSV and Excel export, as well as clipboard operations and the fill handle.
GridOptions
- Javascript - Mutating
gridOptions
after the grid has been created will no longer be picked up by the grid. Instead useapi.setGridOption
(property
,newValue
) to update grid options. - Validation is now run when
gridOptions
are updated, meaning warnings may appear in console when changing grid options if an invalid configuration is reached. serverSideStoreType
- removed, usesuppressServerSideInfiniteScroll
instead. When false, Partial Store is used. When true, Full Store is used.serverSideSortingAlwaysResets
- removed, useserverSideSortAllLevels
instead.serverSideFilteringAlwaysResets
- removed, useserverSideOnlyRefreshFilteredGroups
instead.processSecondaryColDef
- removed, useprocessPivotResultColDef
instead.processSecondaryColGroupDef
- removed, useprocessPivotResultColGroupDef
instead.getServerSideStoreParams
- removed, usegetServerSideGroupLevelParams
instead.onRowDataChanged
: no longer fired, useonRowDataUpdated
instead.getRowId
is now an initial property and can no longer be updated.rememberGroupStateWhenNewData
- removed. Provide getRowId to maintain group state when row data updated instead (see Updating Row Data).
Column Layout
The total width of the pinned column sections (left and right) will be limited to the width of the grid - 50px. This ensures the unpinned columns area is always visible. If total width of the pinned column sections (left and right) exceeds the limit, the grid will automatically unpin columns from the pinned sections to make the unpinned columns visible again. To customise which columns get unpinned or to prevent automatic unpinning, see Resizing Pinned Sections.
Column Filters
IServerSideGetRowsRequest.filterModel
can now be of type AdvancedFilterModel | null if Advanced Filter is enabled, or FilterModel otherwise (for Column Filters).- Added new localisation keys for the Date Filter -
lessThan
is nowbefore
, andgreaterThan
is nowafter
. Please provide translations for these 2 new keys in your localized dictionaries to display your translation instead of the English strings for "before" and "after".
Row Data
Setting rowData
to null
/undefined
via a call to api.setRowData
or via a state variable no longer clears the rows shown in the grid. Instead, set rowData
to []
to clear the rows shown in the grid.
Row Grouping
- Group values will no longer be typeless, and will be inferred from the first row when they were created.
- When using row grouping with
groupDisplayType=singleColumn
(which is the default behavior) and displaying checkboxes in the auto-group column, checkboxes in leaf rows are only displayed ifautoGroupColumnDef
provides a field or a valueGetter to show values in leaf row cells. If you'd like to show checkboxes in the group columns for leaf rows, provide a field or valueGetter in theautoGroupColumnDef
.
Pagination
When showing the pagination controls, the page size selector is shown by default. You can prevent this by setting paginationPageSizeSelector=false
.
Sever-Side Row Model
ServerSideGroupLevelParams.storeType
- removed, usesuppressInfiniteScroll
instead. When false, Partial Store is used. When true, Full Store is used.IsApplyServerSideTransactionParams.storeInfo
- removed, useIsApplyServerSideTransactionParams.groupLevelInfo
instead.LoadSuccessParams.storeInfo
- removed, useLoadSuccessParams.groupLevelInfo
instead.IServerSideGetRowsParams.successCallback
- removed, usesuccess
method withLoadSuccessParams
params instead.IServerSideGetRowsParams.failCallback
- removed, usefail
instead.- interface
ServerSideStoreParams
- removed, useServerSideGroupLevelParams
instead. - interface
GetServerSideStoreParamsParams
- removed, useGetServerSideGroupLevelParamsParams
instead. - interface
RefreshStoreParams
- removed, useRefreshServerSideParams
instead. - interface
ServerSideGroupState
- removed, useServerSideGroupLevelState
instead.
Export
ExcelExportParams
no longer have the following options (removed without replacement due to removing support for export as XML):exportMode
suppressTextAsCDATA
columnGroups
: groups are exported by default.skipGroups
- removed, useskipRowGroups
instead.skipHeader
- removed, useskipColumnHeaders
instead.customFooter
- removed, useappendContent
instead.customHeader
- removed, useprependContent
instead.- interface
RangeSelection
- removed, useCellRange
instead. - interface
AddRangeSelectionParams
- removed, useCellRangeParams
instead.
Column API
getAllColumns
- removed, useapi.getColumns
instead.getPrimaryColumns
- removed, useapi.getColumns
instead.getSecondaryColumns
- removed, useapi.getPivotResultColumns
instead.setSecondaryColumns
- removed, useapi.setPivotResultColumns
instead.getSecondaryPivotColumn
- removed, useapi.getPivotResultColumn
instead.
Grid API
refreshServerSideStore
- removed, userefreshServerSide
instead.getServerSideStoreState
- removed, usegetServerSideGroupLevelState
instead.setProcessSecondaryColDef
- removed, useapi.setGridOption
(processPivotResultColDef
,newValue
) instead.setProcessSecondaryColGroupDef
- removed, useapi.setGridOption
(setProcessPivotResultColGroupDef
,newValue
) instead.setGetServerSideStoreParams
- removed, useapi.setGridOption
(getServerSideGroupLevelParams
,newValue
) instead.
Deprecations
This release includes the following deprecations:
Creating AG Grid
new agGrid.Grid(...)
is deprecated. Use agGrid.createGrid
API instead: const gridApi = agGrid.createGrid(...)
.
GridOptions
- When using
agGrid.createGrid
API,gridOptions.api
is deprecated. Use the grid API reference that is returned byagGrid.createGrid(...)
instead. advancedFilterModel
- deprecated, useinitialState.filter.advancedFilterModel
instead.suppressAsyncEvents
and synchronous event handling is deprecated. Please update your events to be handled asynchronously.
Column Filters
IFilterParams.valueGetter
- deprecated, use IFilterParams.getValue
instead.
Column API
Column API is now deprecated. Column API methods are now available in Grid API instead.
Grid API
setGetRowId
is now deprecated becausegetRowId
can no longer be updated (listed as a breaking change above).The Grid API methods listed below have been deprecated. Please use Grid API methods
setGridOption
andupdateGridOptions
to set properties instead as described in Updating Grid Options.setPivotMode
setPinnedTopRowData
setPinnedBottomRowData
setPopupParent
setSuppressModelUpdateAfterUpdateTransaction
setDataTypeDefinitions
setPagination
paginationSetPageSize
setSideBar
setSuppressClipboardPaste
setGroupRemoveSingleChildren
setGroupRemoveLowestSingleChildren
setGroupDisplayType
setGroupIncludeFooter
setGroupIncludeTotalFooter
setRowClass
setDeltaSort
setSuppressRowDrag
setSuppressMoveWhenRowDragging
setSuppressRowClickSelection
setEnableAdvancedFilter
setIncludeHiddenColumnsInAdvancedFilter
setAdvancedFilterParent
setAdvancedFilterBuilderParams
setQuickFilter
setExcludeHiddenColumnsFromQuickFilter
setIncludeHiddenColumnsInQuickFilter
setQuickFilterParser
setQuickFilterMatcher
setAlwaysShowHorizontalScroll
setAlwaysShowVerticalScroll
setFunctionsReadOnly
setColumnDefs
setAutoGroupColumnDef
setDefaultColDef
setColumnTypes
setTreeData
setServerSideDatasource
setCacheBlockSize
setDatasource
setViewportDatasource
setRowData
setEnableCellTextSelection
setHeaderHeight
setDomLayout
setFillHandleDirection
setGroupHeaderHeight
setFloatingFiltersHeight
setPivotHeaderHeight
setPivotGroupHeaderHeight
setAnimateRows
setIsExternalFilterPresent
setDoesExternalFilterPass
setNavigateToNextCell
setTabToNextCell
setTabToNextHeader
setNavigateToNextHeader
setRowGroupPanelShow
setGetGroupRowAgg
setGetBusinessKeyForNode
setGetChildCount
setProcessRowPostCreate
setGetRowClass
setIsFullWidthRow
setIsRowSelectable
setIsRowMaster
setPostSortRows
setGetDocument
setGetContextMenuItems
setGetMainMenuItems
setProcessCellForClipboard
setSendToClipboard
setProcessCellFromClipboard
setProcessPivotResultColDef
setProcessPivotResultColGroupDef
setPostProcessPopup
setInitialGroupOrderComparator
setGetChartToolbarItems
setPaginationNumberFormatter
setGetServerSideGroupLevelParams
setIsServerSideGroupOpenByDefault
setIsApplyServerSideTransaction
setIsServerSideGroup
setGetServerSideGroupKey
setGetRowStyle
setGetRowHeight
Changes List
If you would like to see the full list of changes in this release, please see the Changelog.