import { GridOptions , RowHeightParams } from '@ag-grid-community/core' ; const gridOptions = { columnDefs : [ { field : 'rowHeight' } , { field : 'athlete' } , { field : 'age' , width : 80 } , { field : 'country' } , { field : 'year' , width : 90 } , { field : 'date' } , { field : 'sport' } , { field : 'gold' } , { field : 'silver' } , { field : 'bronze' } , { field : 'total' } , ] , defaultColDef : { width : 150 , sortable : true , resizable : true , filter : true , } , getRowHeight : getRowHeight , } ; function getRowHeight ( params ) { return params . data . rowHeight ; } 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 ( function ( data ) { var differentHeights = [ 40 , 80 , 120 , 200 ] ; data . forEach ( function ( dataItem , index ) { dataItem . rowHeight = differentHeights [ index % 4 ] ; } ) ; gridOptions . api ! . setRowData ( data ) ; } ) ; } ) ;