API REFERENCE

contextMenuItemClicked

Emitted when a cell context-menu item runs. Read its item ID and target cell position.

What does this API do?

Emitted when a cell context-menu item runs. Read its item ID and target cell position.

API for Pro features: Built-in context menu

Exact input and result types

typescript
contextMenuItemClicked: { id: string; rowIndex: number; field?: string }

Usage flow

Subscribe with grid.addEventListener('contextMenuItemClicked', handler). The result is in event.detail, and event names are case-sensitive. Remove subscriptions when disposing of the view.

javascript
const controller = new AbortController();
grid.addEventListener('contextMenuItemClicked', event => {
  console.log(event.detail);
}, { signal: controller.signal });
// On view disposal: controller.abort();

Feature explanations and examples