What's New
See the release post for details of what's new in version 31.1.
Codemods
Follow these steps to upgrade your project's AG Grid version to 31.1.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 your project's
package.json
to version31.1.0
.Open a terminal and navigate to your project's root folder.
Run the
migrate
command of version31.1
of the AG Grid codemod runner, where$FROM_VERSION
refers to your project's existing AG Grid version:npx @ag-grid-devtools/cli@31.1 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.
Deprecations
This release includes the following deprecations:
GridOptions
gridOptions.cellFlashDelay
- deprecated, usegridOptions.cellFlashDuration
instead.gridOptions.cellFadeDelay
- deprecated, usegridOptions.cellFadeDuration
instead.colDef.floatingFilterComponentParams.suppressFilterButton
- deprecated, usecolDef.suppressFloatingFilterButton
instead.suppressServerSideInfiniteScroll
- deprecated without replacement.serverSideSortOnServer
- deprecated without replacement.serverSideFilterOnServer
- deprecated without replacement.
Column Filters
api.getFilterInstance
- deprecated, useapi.getColumnFilterInstance
instead. To get/set individual filter models, useapi.getColumnFilterModel
orapi.setColumnFilterModel
instead.
Column API
suppressMenu
- deprecated, usesuppressHeaderMenuButton
instead.columnsMenuParams
- deprecated, usecolumnChooserParams
instead.column.getMenuTabs
- deprecated, usecolumns.getColDef.menuTabs ?? defaultValues
instead.
Grid API
getModel
- deprecated, use grid API methods listed in Accessing Data.getModel().getRow(index)
- deprecated, useapi.getDisplayedRowAtIndex(index)
instead.getModel().getRowNode(id)
- deprecated, useapi.getRowNode(id)
instead.getModel().getRowCount()
- deprecated, useapi.getDisplayedRowCount()
instead.getModel().isEmpty()
- deprecated, use!!api.getDisplayedRowCount()
instead.getModel().forEachNode()
- deprecated, useapi.forEachNode()
instead.getFirstDisplayedRow
- deprecated, useapi.getFirstDisplayedRowIndex
instead.getLastDisplayedRow
- deprecated, useapi.getLastDisplayedRowIndex
instead.flashCells
,flashDelay
andfadeDelay
params are deprecated in favor offlashDuration
andfadeDuration
params.showColumnMenuAfterButtonClick
- deprecated, useIHeaderParams.showColumnMenu
within a header component, orapi.showColumnMenu
elsewhere.showColumnMenuAfterMouseClick
- deprecated, useIHeaderParams.showColumnMenuAfterMouseClick
within a header component, orapi.showColumnMenu
elsewhere.removeRowGroupColumn
- deprecated, useremoveRowGroupColumns
providing the single string input param in an array instead.addRowGroupColumn
- deprecated, useaddRowGroupColumns
providing the single string input param in an array instead.setColumnPinned
- deprecated, usesetColumnsPinned
providing the single string input param in an array instead.removePivotColumn
- deprecated, useremovePivotColumns
providing the single string input param in an array instead.addPivotColumn
- deprecated, useaddPivotColumns
providing the single string input param in an array instead.addAggFunc
- deprecated, useaddAggFuncs
providing the single string input param in an array instead.removeValueColumn
- deprecated, useremoveValueColumns
providing the single string input param in an array instead.addValueColumn
- deprecated, useaddValueColumns
providing the single string input param in an array instead.autoSizeColumn
- deprecated, useautoSizeColumns
providing the single string input param in an array instead.moveColumn
- deprecated, usemoveColumns
providing the single string input param in an array instead.setColumnWidth
- deprecated, usesetColumnWidths
providing the single string input param in an array instead.setColumnVisible
- deprecated, usesetColumnsVisible
providing the single string input param in an array instead.
Custom Components
- When implementing a custom date component,
IDate.onParamsUpdated
has been deprecated in favour ofIDate.refresh
. - When implementing a custom floating filter component,
IFloatingFilter.onParamsUpdated
has been deprecated in favour ofIFloatingFilter.refresh
.