> For the complete documentation index, see [llms.txt](https://ghiscoding.gitbook.io/aurelia-slickgrid/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ghiscoding.gitbook.io/aurelia-slickgrid/events/available-events.md).

# Available events

(see below for full list of events)

All the events are published with a data payload in a `CustomEvent`, so you will typically find the payload under the `detail` property of the `CustomEvent`. However please note that the events from `SlickGrid` and `SlickDataView`, shown at the bottom of the list, are published with a different structure which is also including the JS event that it was triggered with under the property `eventData` and the payload itself is under the `args` property (which follows original SlickGrid structure). To subscribe to all events, you can use your PubSub instance (if available) or add listeners on your grid container DOM element.

### `SlickGrid` and `SlickDataView`

```ts
// 1. with PubSub instance
this.aureliaGrid.instances?.eventPubSubService?.subscribe('onCellChange', (payload) => console.log('PubSub, cell changed data:', payload));

// 2. with CustomEvent in the View (see html code below)
handleOnCellChange(e, args) {
  // `eventData` is the event it was triggered from and `args` is the data payload
  const { eventData, args } = e.detail;
  const dataContext = args?.item;
  console.log('cell changed data:', args);
}
```

```html
<!-- 2. with CustomEvent in the View -->
<aurelia-slickgrid
  grid-id="gridId"
  columns.bind="columnDefs"
  options.bind="gridOptions"
  dataset.bind="myDataset"
  on-cell-change.trigger="handleOnCellChange($event.detail)">
</aurelia-slickgrid>
```

### all other events

```ts
// 1. with PubSub instance
this.aureliaGrid.instances?.eventPubSubService?.subscribe('onHeaderMenuCommand', (payload) => console.log('PubSub, header menu command', payload));

// 2. with CustomEvent in the View (see html code below)
handleOnHeaderMenuCommand(e) {
  // detail is the args data payload
  const args = e.detail;
  console.log('header menu command', args);
}
```

```html
<!-- 2. with CustomEvent in the View -->
<aurelia-slickgrid
  grid-id="gridId"
  columns.bind="columnDefs"
  options.bind="gridOptions"
  dataset.bind="myDataset"
  on-header-menu-command.trigger="handleOnHeaderMenuCommand($event.detail.eventData, $event.detail.args)">
</aurelia-slickgrid>
```

***

### CellExternalCopyManager (extension)

* `onCopyCells`
* `onCopyCancelled`
* `onPasteCells`
* `onBeforePasteCell`

### Context Menu / Cell Menu (extension)

* `onContextMenuClearGrouping`
* `onContextMenuCollapseAllGroups`
* `onContextMenuExpandAllGroups`
* **Slick Events**
  * `onAfterMenuShow`
  * `onBeforeMenuShow`
  * `onBeforeMenuClose`
  * `onCommand`
  * `onOptionSelected`

### Column Picker (extension)

* `onColumnPickerColumnsChanged`
* **Slick Events**
  * `onColumnsChanged`

### Grid Menu (extension)

* `onGridMenuMenuClose`
* `onGridMenuBeforeMenuShow`
* `onGridMenuAfterMenuShow`
* `onGridMenuClearAllPinning`
* `onGridMenuClearAllFilters`
* `onGridMenuClearAllSorting`
* `onGridMenuColumnsChanged`
* `onGridMenuCommand`
* **Slick Events**
  * `onAfterMenuShow`
  * `onBeforeMenuShow`
  * `onBeforeMenuClose`
  * `onColumnsChanged`
  * `onMenuClose`
  * `onCommand`

### Header Buttons (extension)

* `onHeaderButtonCommand`

### Header Menu (extension)

* `onHeaderMenuCommand`
* `onHeaderMenuColumnResizeByContent`
* `onHeaderMenuBeforeMenuShow`
* `onHeaderMenuAfterMenuShow`

### Export Services

* `onAfterExportToExcel`
* `onBeforeExportToExcel`
* `onBeforeExportToTextFile`
* `onAfterExportToTextFile`

### Filter Service

* `onBeforeFilterClear`
* `onBeforeSearchChange`
* `onFilterCleared`

### Grid Service

* `onHideColumns`
* `onItemsAdded`
* `onItemsDeleted`
* `onItemsUpdated`
* `onItemsUpserted`

### GridState Service

* `onFullResizeByContentRequested`
* `onGridStateChanged`

### Pagination Service

* `onBeforePaginationChange`
* `onPaginationChanged`
* `onPaginationRefreshed`
* `onPaginationPresetsInitialized`
* `onPaginationVisibilityChanged`
* `onPaginationSetCursorBased` (for GraphQL only)

### Resizer Service

* `onGridBeforeResize`
* `onGridAfterResize`
* `onBeforeResizeByContent`
* `onAfterResizeByContent`

### Sort Service

* `onSortCleared`
* `onSortChanged`
* `onBeforeSortChange`

### TreeData Service

* `onTreeFullToggleStart`
* `onTreeFullToggleEnd`
* `onTreeItemToggled`

### Aurelia-Slickgrid Component

* `onBeforeGridDestroy`
* `onBeforeGridCreate`
* `onDataviewCreated`
* `onGridCreated`
* `onAureliaGridCreated`
* `onGridStateChanged`

### SlickGrid

* `onActiveCellChanged`
* `onActiveCellPositionChanged`
* `onAddNewRow`
* `onAfterSetColumns`
* `onAutosizeColumns`
* `onBeforeAppendCell`
* `onBeforeCellEditorDestroy`
* `onBeforeColumnsResize`
* `onBeforeDestroy`
* `onBeforeEditCell`
* `onBeforeFooterRowCellDestroy`
* `onBeforeHeaderCellDestroy`
* `onBeforeHeaderRowCellDestroy`
* `onBeforeRemoveCachedRow`
* `onBeforeSetColumns`
* `onBeforeSort`
* `onBeforeUpdateColumns`
* `onCellChange`
* `onCellCssStylesChanged`
* `onClick`
* `onColumnsReordered`
* `onColumnsDrag`
* `onColumnsResized`
* `onColumnsResizeDblClick`
* `onCompositeEditorChange`
* `onContextMenu`
* `onDblClick`
* `onDrag`
* `onDragInit`
* `onDragStart`
* `onDragEnd`
* `onFooterClick`
* `onFooterContextMenu`
* `onFooterRowCellRendered`
* `onHeaderCellRendered`
* `onHeaderClick`
* `onHeaderContextMenu`
* `onHeaderMouseEnter`
* `onHeaderMouseLeave`
* `onHeaderMouseOver`
* `onHeaderMouseOut`
* `onHeaderRowCellRendered`
* `onHeaderRowMouseEnter`
* `onHeaderRowMouseLeave`
* `onHeaderRowMouseOver`
* `onHeaderRowMouseOut`
* `onKeyDown`
* `onMouseEnter`
* `onMouseLeave`
* `onPreHeaderClick`
* `onPreHeaderContextMenu`
* `onRendered`
* `onScroll`
* `onSelectedRowsChanged`
* `onSetOptions`
* `onActivateChangedOptions`
* `onSort`
* `onValidationError`
* `onViewportChanged`

### SlickDataView

* `onBeforePagingInfoChanged`
* `onGroupExpanded`
* `onGroupCollapsed`
* `onPagingInfoChanged`
* `onRowCountChanged`
* `onRowsChanged`
* `onRowsOrCountChanged`
* `onSelectedRowIdsChanged`
* `onSetItemsCalled`


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://ghiscoding.gitbook.io/aurelia-slickgrid/events/available-events.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
