import { CellValueChangedEvent , GridOptions , ValueParserParams } from '@ag-grid-community/core' ; const gridOptions = { columnDefs : [ { headerName : 'Name' , field : 'simple' } , { headerName : 'Bad Number' , field : 'numberBad' } , { headerName : 'Good Number' , field : 'numberGood' , valueParser : numberParser , } , ] , defaultColDef : { flex : 1 , editable : true , resizable : true , } , rowData : getData ( ) , onCellValueChanged : ( event ) => { console . log ( 'data after changes is: ' , event . data ) ; } , } ; function numberParser ( params ) { return Number ( params . newValue ) ; } document . addEventListener ( 'DOMContentLoaded' , function ( ) { var gridDiv = document . querySelector ( '#myGrid' ) ; new agGrid . Grid ( gridDiv , gridOptions ) ; gridOptions . api ! . sizeColumnsToFit ( ) ; } ) ;