import { ColDef , GridOptions } from '@ag-grid-community/core' ; const columnDefs = [ { field : 'make' } , { field : 'model' } , { field : 'price' } , ] ; var rowData = [ { make : 'Toyota' , model : 'Celica' , price : 35000 } , { make : 'Ford' , model : 'Mondeo' , price : 32000 } , { make : 'Porsche' , model : 'Boxter' , price : 72000 } , ] ; const gridOptions = { columnDefs : columnDefs , rowData : rowData , onGridReady : function ( params ) { params . api . sizeColumnsToFit ( ) ; } , defaultColDef : { editable : true , sortable : true , resizable : true , filter : true , flex : 1 , minWidth : 100 , } , } ; document . addEventListener ( 'DOMContentLoaded' , function ( ) { var eGridDiv = document . querySelector ( '#myGrid' ) ; new agGrid . Grid ( eGridDiv , gridOptions ) ; } ) ;