0

im creating a custom filter, the functionality is basically the same that is built-in in the ag-grid.

Is the:

var NumberFilter = (function () {
        function NumberFilter() {
        }
        NumberFilter.prototype.init

The only difference is that i only need to change the function

NumberFilter.prototype.onFilterChanged

To replace commas by dots. But to overwrite all the methods it doesnt makes much sense, is there a way in inherite the functionality of the filter 'number' and change only the NumberFilter.prototype.onFilterChanged?

Marco Santos
  • 915
  • 2
  • 11
  • 24

1 Answers1

0

You should use Javascript inheritance on NumberFilter and then overtwrite the method onFilterChanged. Check this answer to see how to do it : JavaScript override methods

Then instead of specifying

filter:'number'

You can do :

filter:new MyNumberFilter();

As you can see i instanciated the filter, it's required or you will have the same instance for all your number column's filter on the grid.

Community
  • 1
  • 1
Walfrat
  • 5,363
  • 1
  • 16
  • 35