# getContextMenuItems

Calculates context-menu items for a displayed row and field.

Canonical: https://grid.syidax.com/docs/methods/getContextMenuItems/

<a id="meaning"></a>

## What does this API do?

Calculates context-menu items for a displayed row and field.

API for Pro features: Built-in context menu

<a id="contract"></a>

## Exact input and result types

```typescript
getContextMenuItems(target: { rowIndex: number; field?: string }): Promise<ContextMenuItem[]>
```

| Arguments | Required | Type |
| --- | --- | --- |
| target | Required | { rowIndex: number; field?: string } |

The return type is `Promise<ContextMenuItem[]>`.

<a id="usage"></a>

## Usage flow

After registering and initializing the Grid element, call grid.getContextMenuItems(…). Read the return value with await. For methods returning a boolean or report, inspect the result before continuing.

<a id="types"></a>

## Read related types

- [ContextMenuItem](https://grid.syidax.com/docs/types/ContextMenuItem.md)

<a id="recipes"></a>

## Feature explanations and examples

- [Cell context menus](https://grid.syidax.com/docs/features/context-menu.md) — A cell's context menu offers actions such as Copy, Copy row, and Export for the current location. Also provide toolbar or keyboard access to frequently used features.
