import { GridOptions } from '@ag-grid-community/core' ; var filterParams = { textFormatter : replaceAccents , } ; const gridOptions = { columnDefs : [ { field : 'athlete' , filter : 'agSetColumnFilter' , filterParams : filterParams , } , { field : 'gold' , filter : 'agNumberColumnFilter' } , { field : 'silver' , filter : 'agNumberColumnFilter' } , { field : 'bronze' , filter : 'agNumberColumnFilter' } , ] , defaultColDef : { flex : 1 , minWidth : 200 , resizable : true , floatingFilter : true , } , } ; function replaceAccents ( value ) { return value . replace ( new RegExp ( '[àáâãäå]' , 'g' ) , 'a' ) . replace ( new RegExp ( 'æ' , 'g' ) , 'ae' ) . replace ( new RegExp ( 'ç' , 'g' ) , 'c' ) . replace ( new RegExp ( '[èéêë]' , 'g' ) , 'e' ) . replace ( new RegExp ( '[ìíîï]' , 'g' ) , 'i' ) . replace ( new RegExp ( 'ñ' , 'g' ) , 'n' ) . replace ( new RegExp ( '[òóôõøö]' , 'g' ) , 'o' ) . replace ( new RegExp ( 'œ' , 'g' ) , 'oe' ) . replace ( new RegExp ( '[ùúûü]' , 'g' ) , 'u' ) . replace ( new RegExp ( '[ýÿ]' , 'g' ) , 'y' ) . replace ( new RegExp ( '\\W' , 'g' ) , '' ) ; } document . addEventListener ( 'DOMContentLoaded' , function ( ) { var gridDiv = document . querySelector ( '#myGrid' ) ; new agGrid . Grid ( gridDiv , gridOptions ) ; fetch ( 'https://www.ag-grid.com/example-assets/olympic-winners.json' ) . then ( response => response . json ( ) ) . then ( data => gridOptions . api ! . setRowData ( data ) ) ; } ) ;