import { GridOptions , RowDragEndEvent , RowDragEnterEvent , RowDragLeaveEvent , RowDragMoveEvent } from '@ag-grid-community/core' ; const gridOptions = { columnDefs : [ { field : 'athlete' , rowDrag : true } , { field : 'country' } , { field : 'year' , width : 100 } , { field : 'date' } , { field : 'sport' } , { field : 'gold' } , { field : 'silver' } , { field : 'bronze' } , ] , defaultColDef : { width : 170 , sortable : true , filter : true , } , animateRows : true , onRowDragEnter : onRowDragEnter , onRowDragEnd : onRowDragEnd , onRowDragMove : onRowDragMove , onRowDragLeave : onRowDragLeave , } ; function onRowDragEnter ( e ) { console . log ( 'onRowDragEnter' , e ) ; } function onRowDragEnd ( e ) { console . log ( 'onRowDragEnd' , e ) ; } function onRowDragMove ( e ) { console . log ( 'onRowDragMove' , e ) ; } function onRowDragLeave ( e ) { console . log ( 'onRowDragLeave' , e ) ; } 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 ) ) ; } ) ;