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.jsonand note the version of AG Grid that you are currently using.Update any AG Grid dependencies listed in the
package.jsonto version31.0.0.Open a terminal and navigate to your project's root folder.
Run the
migratecommand of version31.0of the AG Grid codemod runner, where$FROM_VERSIONrefers to your project's existing AG Grid version:npx @ag-grid-devtools/cli@31.0 migrate --from=$FROM_VERSIONThis 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
migratecommand, or specify the--helpargument 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
AgGridReactFireis no longer exported fromag-grid-react. You should useAgGridReactinstead.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
gridOptionsare 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).
rowDataUpdatedevent is only fired for the Client-Side Row Model (per the existing documentation)."Legacy React Rendering, enabled via
suppressReactUiproperty 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 = falseandgridOptions.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
columnDefstonull/undefinedvia a call toapi.setColumnDefsor via a state variable no longer clears the columns shown in the grid. Instead, setcolumnDefsto[]to clear the columns shown in the grid.
GridOptions
- Javascript - Mutating
gridOptionsafter 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
gridOptionsare updated, meaning warnings may appear in console when changing grid options if an invalid configuration is reached. serverSideStoreType- removed, usesuppressServerSideInfiniteScrollinstead. When false, Partial Store is used. When true, Full Store is used.serverSideSortingAlwaysResets- removed, useserverSideSortAllLevelsinstead.serverSideFilteringAlwaysResets- removed, useserverSideOnlyRefreshFilteredGroupsinstead.processSecondaryColDef- removed, useprocessPivotResultColDefinstead.processSecondaryColGroupDef- removed, useprocessPivotResultColGroupDefinstead.getServerSideStoreParams- removed, usegetServerSideGroupLevelParamsinstead.onRowDataChanged: no longer fired, useonRowDataUpdatedinstead.getRowIdis 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 Filters
IServerSideGetRowsRequest.filterModelcan 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 -
lessThanis nowbefore, andgreaterThanis 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 ifautoGroupColumnDefprovides 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, usesuppressInfiniteScrollinstead. When false, Partial Store is used. When true, Full Store is used.IsApplyServerSideTransactionParams.storeInfo- removed, useIsApplyServerSideTransactionParams.groupLevelInfoinstead.LoadSuccessParams.storeInfo- removed, useLoadSuccessParams.groupLevelInfoinstead.IServerSideGetRowsParams.successCallback- removed, usesuccessmethod withLoadSuccessParamsparams instead.IServerSideGetRowsParams.failCallback- removed, usefailinstead.- interface
ServerSideStoreParams- removed, useServerSideGroupLevelParamsinstead. - interface
GetServerSideStoreParamsParams- removed, useGetServerSideGroupLevelParamsParamsinstead. - interface
RefreshStoreParams- removed, useRefreshServerSideParamsinstead. - interface
ServerSideGroupState- removed, useServerSideGroupLevelStateinstead.
Export
ExcelExportParamsno longer have the following options (removed without replacement due to removing support for export as XML):exportModesuppressTextAsCDATA
columnGroups: groups are exported by default.skipGroups- removed, useskipRowGroupsinstead.skipHeader- removed, useskipColumnHeadersinstead.customFooter- removed, useappendContentinstead.customHeader- removed, useprependContentinstead.- interface
RangeSelection- removed, useCellRangeinstead. - interface
AddRangeSelectionParams- removed, useCellRangeParamsinstead.
Column API
getAllColumns- removed, useapi.getColumnsinstead.getPrimaryColumns- removed, useapi.getColumnsinstead.getSecondaryColumns- removed, useapi.getPivotResultColumnsinstead.setSecondaryColumns- removed, useapi.setPivotResultColumnsinstead.getSecondaryPivotColumn- removed, useapi.getPivotResultColumninstead.
Grid API
refreshServerSideStore- removed, userefreshServerSideinstead.getServerSideStoreState- removed, usegetServerSideGroupLevelStateinstead.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.createGridAPI,gridOptions.apiis deprecated. Use the grid API reference that is returned byagGrid.createGrid(...)instead. advancedFilterModel- deprecated, useinitialState.filter.advancedFilterModelinstead.suppressAsyncEventsand 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
setGetRowIdis now deprecated becausegetRowIdcan no longer be updated (listed as a breaking change above).The Grid API methods listed below have been deprecated. Please use Grid API methods
setGridOptionandupdateGridOptionsto set properties instead as described in Updating Grid Options.setPivotModesetPinnedTopRowDatasetPinnedBottomRowDatasetPopupParentsetSuppressModelUpdateAfterUpdateTransactionsetDataTypeDefinitionssetPaginationpaginationSetPageSizesetSideBarsetSuppressClipboardPastesetGroupRemoveSingleChildrensetGroupRemoveLowestSingleChildrensetGroupDisplayTypesetGroupIncludeFootersetGroupIncludeTotalFootersetRowClasssetDeltaSortsetSuppressRowDragsetSuppressMoveWhenRowDraggingsetSuppressRowClickSelectionsetEnableAdvancedFiltersetIncludeHiddenColumnsInAdvancedFiltersetAdvancedFilterParentsetAdvancedFilterBuilderParamssetQuickFiltersetExcludeHiddenColumnsFromQuickFiltersetIncludeHiddenColumnsInQuickFiltersetQuickFilterParsersetQuickFilterMatchersetAlwaysShowHorizontalScrollsetAlwaysShowVerticalScrollsetFunctionsReadOnlysetColumnDefssetAutoGroupColumnDefsetDefaultColDefsetColumnTypessetTreeDatasetServerSideDatasourcesetCacheBlockSizesetDatasourcesetViewportDatasourcesetRowDatasetEnableCellTextSelectionsetHeaderHeightsetDomLayoutsetFillHandleDirectionsetGroupHeaderHeightsetFloatingFiltersHeightsetPivotHeaderHeightsetPivotGroupHeaderHeightsetAnimateRowssetIsExternalFilterPresentsetDoesExternalFilterPasssetNavigateToNextCellsetTabToNextCellsetTabToNextHeadersetNavigateToNextHeadersetRowGroupPanelShowsetGetGroupRowAggsetGetBusinessKeyForNodesetGetChildCountsetProcessRowPostCreatesetGetRowClasssetIsFullWidthRowsetIsRowSelectablesetIsRowMastersetPostSortRowssetGetDocumentsetGetContextMenuItemssetGetMainMenuItemssetProcessCellForClipboardsetSendToClipboardsetProcessCellFromClipboardsetProcessPivotResultColDefsetProcessPivotResultColGroupDefsetPostProcessPopupsetInitialGroupOrderComparatorsetGetChartToolbarItemssetPaginationNumberFormattersetGetServerSideGroupLevelParamssetIsServerSideGroupOpenByDefaultsetIsApplyServerSideTransactionsetIsServerSideGroupsetGetServerSideGroupKeysetGetRowStylesetGetRowHeight
Changes List
If you would like to see the full list of changes in this release, please see the Changelog.