Vue Data Grid: Grid Events
This is a list of the events that the grid raises. You can register callbacks for these events through the GridOptions interface.
The name of the callback is constructed by prefixing the event name with on. For example, the callback for the cellClicked event is gridOptions.onCellClicked.
const gridOptions = {
// Add event handlers
onCellClicked: (event: CellClickedEvent) => console.log('Cell was clicked'),
}Alternatively provide your event handler to the relevant event callback on the ag-grid-vue component.
onCellClicked = (params) => console.log('Cell was clicked');
<ag-grid-vue @cell-clicked="onCellClicked"> </ag-grid-vue> TypeScript users can take advantage of the events' interfaces. You can construct the interface name by suffixing the event name with Event. For example, the cellClicked event uses the interface CellClickedEvent.
Selection
cellClickedCellClickedEvent | Cell is clicked. | |
cellDoubleClickedCellDoubleClickedEvent | Cell is double clicked. | |
cellFocusedCellFocusedEvent | Cell is focused. | |
cellMouseOverCellMouseOverEvent | Mouse entered cell. | |
cellMouseOutCellMouseOutEvent | Mouse left cell. | |
cellMouseDownCellMouseDownEvent | Mouse down on cell. | |
rowClickedRowClickedEvent | Row is clicked. | |
rowDoubleClickedRowDoubleClickedEvent | Row is double clicked. | |
rowSelectedRowSelectedEvent | Row is selected or deselected. | |
selectionChangedSelectionChangedEvent | Row selection is changed. Use the grid API to get the new row selected. | |
cellContextMenuCellContextMenuEvent | Cell is right clicked. | |
rangeSelectionChangedRangeSelectionChangedEvent | A change to range selection has occurred. |
Editing
cellValueChangedCellValueChangedEvent | Value has changed after editing. | |
rowValueChangedRowValueChangedEvent | A cell's value within a row has changed. This event corresponds to Full Row Editing only. | |
cellEditingStartedCellEditingStartedEvent | Editing a cell has started. | |
cellEditingStoppedCellEditingStoppedEvent | Editing a cell has stopped. | |
rowEditingStartedRowEditingStartedEvent | Editing a row has started (when row editing is enabled). When row editing, this event will be fired once and cellEditingStarted will be fired for each individual cell. This event corresponds to Full Row Editing only. | |
rowEditingStoppedRowEditingStoppedEvent | Editing a row has stopped (when row editing is enabled). When row editing, this event will be fired once and cellEditingStopped will be fired for each individual cell. This event corresponds to Full Row Editing only. | |
pasteStartPasteStartEvent | Paste operation has started. See Clipboard Events. | |
pasteEndPasteEndEvent | Paste operation has ended. See Clipboard Events. |
Sort and Filter
sortChangedSortChangedEvent | Sort has changed. The grid also listens for this and updates the model. | |
filterOpenedFilterOpenedEvent | Filter has been opened. | |
filterChangedFilterChangedEvent | Filter has been modified and applied. | |
filterModifiedFilterModifiedEvent | Filter was modified but not applied. Used when filters have 'Apply' buttons. |
Row Drag and Drop
rowDragEnterRowDragEvent | A drag has started, or dragging was already started and the mouse has re-entered the grid having previously left the grid. | |
rowDragMoveRowDragEvent | The mouse has moved while dragging. | |
rowDragLeaveRowDragEvent | The mouse has left the grid while dragging. | |
rowDragEndRowDragEvent | The drag has finished over the grid. |
Columns
columnVisibleColumnVisibleEvent | A column, or group of columns, was hidden / shown. | |
columnPinnedColumnPinnedEvent | A column, or group of columns, was pinned / unpinned. | |
columnResizedColumnResizedEvent | A column was resized. | |
columnMovedColumnMovedEvent | A column was moved. To find out when the column move is finished you can use the dragStopped event below. | |
columnRowGroupChangedColumnRowGroupChangedEvent | A row group column was added or removed. | |
columnValueChangedColumnValueChangedEvent | A value column was added or removed. | |
columnPivotModeChangedColumnPivotModeChangedEvent | The pivot mode flag was changed. | |
columnPivotChangedColumnPivotChangedEvent | A pivot column was added, removed or order changed. | |
columnGroupOpenedColumnGroupOpenedEvent | A column group was opened / closed. | |
newColumnsLoadedNewColumnsLoadedEvent | User set new columns. | |
gridColumnsChangedGridColumnsChangedEvent | The list of grid columns changed. | |
displayedColumnsChangedDisplayedColumnsChangedEvent | The list of displayed columns changed. This can result from columns open / close, column move, pivot, group, etc. | |
virtualColumnsChangedVirtualColumnsChangedEvent | The list of rendered columns changed (only columns in the visible scrolled viewport are rendered by default). | |
columnEverythingChangedColumnEverythingChangedEvent | Shotgun - gets called when either a) new columns are set or b) columnApi.setState() is used, so everything has changed. |
Miscellaneous
gridReadyGridReadyEvent | The grid has initialised. Use this event if, for example, you need to use the grid's API to fix the columns to size. | |
gridSizeChangedGridSizeChangedEvent | The size of the grid div has changed. In other words, the grid was resized. | |
modelUpdatedModelUpdatedEvent | Displayed rows have changed. Triggered after sort, filter or tree expand / collapse events. | |
firstDataRenderedFirstDataRenderedEvent | Fired the first time data is rendered into the grid. | |
rowGroupOpenedRowGroupOpenedEvent | A row group was opened or closed. | |
expandOrCollapseAllExpandCollapseAllEvent | Fired when calling either of the API methods expandAll() or collapseAll(). | |
paginationChangedPaginationChangedEvent | Triggered every time the paging state changes. Some of the most common scenarios for this event to be triggered are:
| |
pinnedRowDataChangedPinnedRowDataChangedEvent | The client has set new pinned row data into the grid. | |
virtualRowRemovedVirtualRowRemovedEvent | A row was removed from the DOM, for any reason. Use to clean up resources (if any) used by the row. | |
viewportChangedViewportChangedEvent | Which rows are rendered in the DOM has changed. | |
bodyScrollBodyScrollEvent | The body was scrolled horizontally or vertically. | |
dragStartedDragStartedEvent | When dragging starts. This could be any action that uses the grid's Drag and Drop service, e.g. Column Moving, Column Resizing, Range Selection, Fill Handle, etc. | |
dragStoppedDragStoppedEvent | When dragging stops. This could be any action that uses the grid's Drag and Drop service, e.g. Column Moving, Column Resizing, Range Selection, Fill Handle, etc. | |
rowDataChangedRowDataChangedEvent | The client has set new data into the grid using api.setRowData() or by changing the rowData bound property. | |
rowDataUpdatedRowDataUpdatedEvent | The client has updated data for the grid using api.applyTransaction(transaction) or by changing the rowData bound property with immutableData=true. | |
toolPanelVisibleChangedToolPanelVisibleChangedEvent | The tool panel was hidden or shown. Use api.isToolPanelShowing() to get status. | |
componentStateChangedComponentStateChangedEvent | Only used by React, Angular and VueJS AG Grid components (not used if doing plain JavaScript or Angular 1.x). If the grid receives changes due to bound properties, this event fires after the grid has finished processing the change. | |
asyncTransactionsFlushedAsyncTransactionsFlushed | Async transactions have been applied. Contains a list of all transaction results. | |
cellKeyDownCellKeyDownEvent | FullWidthCellKeyDownEvent | DOM event keyDown happened on a cell. See Keyboard Events. | |
cellKeyPressCellKeyPressEvent | FullWidthCellKeyPressEvent | DOM event keyPress happened on a cell. See Keyboard Events. |