How to update a Set Filter to ag-grid v21?

Viewed 790

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 BaseFilter to SimpleFilter to access the static operators.
  • redeclared GridCell, GridCellDef, and GridRow which were deleted from ag-grid.
  • renamed property filterParams to providedFilterParams, but that is private so it did not help.
  • renamed method customInit to init.
  • renamed method serialize to getModelFromUi.
  • removed generic types after IFloatingFilter and IFloatingFilterParams.
  • 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'.
0 Answers
Related