What's New Copy Link
See the release post for details of what's new in version 31.
Codemods Copy Link
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@latest migrate --from=$FROM_VERSION --to=31.0This 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 Copy Link
This release includes the following breaking changes:
Integrated Charts Copy Link
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 Copy Link
- 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 behaviour 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. useValueFormatterForExportis 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 Copy Link
- 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 Layout Copy Link
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 Copy Link
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 Copy Link
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 Copy Link
- 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 behaviour) 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 Copy Link
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 Copy Link
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 Copy Link
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 Copy Link
getAllColumns- removed, useapi.getColumnsinstead.getPrimaryColumns- removed, useapi.getColumnsinstead.getSecondaryColumns- removed, useapi.getPivotResultColumnsinstead.setSecondaryColumns- removed, useapi.setPivotResultColumnsinstead.getSecondaryPivotColumn- removed, useapi.getPivotResultColumninstead.
Grid API Copy Link
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 Copy Link
This release includes the following deprecations:
Creating AG Grid Copy Link
new agGrid.Grid(...) is deprecated. Use agGrid.createGrid API instead: const gridApi = agGrid.createGrid(...).
GridOptions Copy Link
- 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 Copy Link
IFilterParams.valueGetter - deprecated, use IFilterParams.getValue instead.
Column API Copy Link
Column API is now deprecated. Column API methods are now available in Grid API instead.
Grid API Copy Link
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 Copy Link
If you would like to see the full list of changes in this release, please see the Changelog.