I have custom BaseSetFilter that extends SetFilter. It works with ag-grid v20.2.0 and does not even build with ag-grid v21.0.1. There are notes about breaking changes (see AG-2946 in ag-grid v21.0.0 changelog) and to create custom floating filters after the Filter Refactor, but no guidance on how to change an existing filter to work with the new version.
What must change to upgrade a custom filter from ag-grid v20 to ag-grid v21? So many breaking changes are not documented.
Here's what I did so far ... none of these were in the release notes or the documentation:
- renamed
BaseFiltertoSimpleFilterto access the static operators. - redeclared
GridCell,GridCellDef, andGridRowwhich were deleted from ag-grid. - renamed property
filterParamstoprovidedFilterParams, but that is private so it did not help. - renamed method
customInittoinit. - renamed method
serializetogetModelFromUi. - removed generic types after
IFloatingFilterandIFloatingFilterParams. - commented out code to satisfy
ng serve.
Typescript (in VS Code and ng serve) reports errors that indicate the filter-related interfaces and classes have changed in breaking ways, e.g.:
- Property 'valueModel' is private and only accessible within class 'SetFilter'.
- Property 'providedFilterParams' is private and only accessible within class 'ProvidedFilter'.
- Property 'translate' does not exist on type 'BaseSetFilter'.
- Property 'onFloatingFilterChanged' does not exist on type 'IFilterComp'.
- Property 'initialiseFilterBodyUi' is private in type 'SetFilter' but not in type 'BaseSetFilter'.