import { GridOptions } from '@ag-grid-community/core' ; const gridOptions = { columnDefs : [ { field : 'jobTitle' } , { field : 'employmentType' } , ] , defaultColDef : { flex : 1 , } , autoGroupColumnDef : { headerName : 'Organisation Hierarchy' , minWidth : 300 , cellRendererParams : { suppressCount : true , } , } , rowData : getData ( ) , treeData : true , animateRows : true , groupDefaultExpanded : - 1 , getDataPath : function ( data ) { return data . orgHierarchy ; } , } ; function onFilterTextBoxChanged ( ) { gridOptions . api ! . setQuickFilter ( ( document . getElementById ( 'filter-text-box' ) as any ) . value ) ; } document . addEventListener ( 'DOMContentLoaded' , function ( ) { var eGridDiv = document . querySelector ( '#myGrid' ) ; new agGrid . Grid ( eGridDiv , gridOptions ) ; } ) ;