# Context Menu

Canonical page: https://www.adaptabletools.com/docs/ui-context-menu

- AdapTable extends AG Grid's cell context menu — AG Grid owns the menu; AdapTable adds module items via `contextMenuOptions.customContextMenu`
- The Context Menu provided by AG Grid (when you right-click in a Cell) is extended by AdapTable
- As a result 3 sets of Menu Items can appear in the Context Menu:
  - Provided by **AG Grid**
  - Shipped by **AdapTable**
  - Supplied by **Developers**
- Developers have full control over the content and order of these sections

The AG Grid Context Menu is accessed by right-clicking any cell in the Grid.

The Menu only displays if the [MenuModule](https://www.adaptabletools.com/docs/getting-started-aggrid-modules/index.md#selecting-modules) (or `AllEnterpriseModules`) is provided to AG Grid

## Topics in this Section

| Topic                                                                                           | Summary                                                |
| ----------------------------------------------------------------------------------------------- | ------------------------------------------------------ |
| This page                                                                                       | AG Grid + AdapTable items, selection-dependent entries |
| [Context Menu Default Structure](https://www.adaptabletools.com/docs/ui-context-menu-default-structure/index.md)  | Default sections, export tree, item `name`s            |
| [Configuring the Context Menu](https://www.adaptabletools.com/docs/ui-context-menu-configuring/index.md)          | Reorder, restructure, remove with `customContextMenu`  |
| [Custom Context Menu Items](https://www.adaptabletools.com/docs/ui-context-menu-custom-items/index.md)            | `UserContextMenuItem` and framework menu rows          |
| [Context Menu Technical Reference](https://www.adaptabletools.com/docs/technical-reference-context-menu/index.md) | `contextMenuOptions`, context types, `contextMenuApi`  |
| [Column Menu](https://www.adaptabletools.com/docs/ui-column-menu/index.md)                                        | Same callback pattern for header menus                 |

## AdapTable Menu Items

AdapTable provides a large number of useful Menu Items — see [Context Menu Default Structure](https://www.adaptabletools.com/docs/ui-context-menu-default-structure/index.md).

These are appended to AG Grid's own Context Menu.

The Menu Items displayed will vary depending on the cell clicked and which other cells are selected

Each Menu Item contains 2 properties which allow developers to reference it, enabling full control over each Menu Item's visibility and position:

- a name
- an associated [AdapTable Module](https://www.adaptabletools.com/docs/technical-reference-adaptable-modules/index.md)

## AG Grid Menu Items

AdapTable makes 2 changes to the default context menu items which are provided by AG Grid:

- it groups the Copy / Paste related items into a "Copy and Paste" menu item (with 5 sub menu items)
- it hides the Export Menu Item (as this is provided in a fuller form by AdapTable's export menu items)

AdapTable also allows developers to change AG Grid's menu items (this can also be done directly in AG Grid)

## Configuring the Context Menu

The Context Menu can be configured at design-time to meet users' requirements.

This is done via the `customContextMenu` property in [Context Menu Options](https://www.adaptabletools.com/docs/technical-reference-context-menu/index.md), which can be used to arrange the Context Menu in multiple ways:

- **reorder** Menu Items
- **restructure** Menu Items
- **remove** Menu Items
- **add** Custom Menu Items

See [Configuring the Context Menu](https://www.adaptabletools.com/docs/ui-context-menu-configuring/index.md) and [Adding Custom Context Menu Items](https://www.adaptabletools.com/docs/ui-context-menu-custom-items/index.md) for full details of these topics

### FAQ

**How does AdapTable relate to AG Grid here?**
AG Grid renders the context menu. AdapTable prepends/appends module items and lets you reshape the combined menu in **`customContextMenu`**. Context exposes the same **structured** and **flat** defaults as the column menu (`defaultAdaptableMenuStructure`, `defaultAgGridMenuStructure`, and flat `*MenuItems` variants).

**How is the Context Menu different from the Column Menu?**
Context items depend on **cell selection** and include sections such as **Export** and **Bulk Update / Smart Edit** that do not appear in the column menu. Default layouts are documented separately — compare the two default structure pages.

**How do I hide or reorder AdapTable items?**
Implement **`customContextMenu`** and filter by `name` using [Context Menu Default Structure](https://www.adaptabletools.com/docs/ui-context-menu-default-structure/index.md).

**Can I add my own menu entries?**
Yes — return **`UserContextMenuItem`** entries from the callback, or see [Custom Context Menu Items](https://www.adaptabletools.com/docs/ui-context-menu-custom-items/index.md).

**I replaced AdapTable items but lost AG Grid Notes — what happened?**
If your callback returns only AdapTable items, include AG Grid's **`note`** entry from **`defaultAgGridMenuStructure`** when Notes are enabled (requires AG Grid Notes support).

**I cannot access the AG Grid Context Menu on my laptop?**
If you are using a trackpad and are unable to access the AG Grid context menu, set `allowContextMenuWithControlKey` to true in GridOptions.

**Can I remove AG Grid menu items?**
Yes - via AG Grid or AdapTable depending whether you want to remove some or all of AG Grid's Menu Items:

- to remove **some** AG Grid menu items (e.g. Copy) use the `GetContextMenuItems` property in [AG Grid Grid Options](https://www.ag-grid.com/javascript-data-grid/context-menu/)
- to remove **all** the AG Grid menu items use the `customContextMenu` property in [Context Menu Options](https://www.adaptabletools.com/docs/technical-reference-context-menu/index.md)

**Can I hide some Menu Options that I do not require?**
Yes, the `customContextMenu` property in [Context Menu Options](https://www.adaptabletools.com/docs/technical-reference-context-menu/index.md) allows you to define which AdapTable Context Menu Items should be displayed

**Why do I not see all the menu options listed on the default structure page?**
There are 2 possibilities:

- check you are not using `customContextMenu` property in [Context Menu Options](https://www.adaptabletools.com/docs/technical-reference-context-menu/index.md) to hide some menu items
- check which [Entitlements](https://www.adaptabletools.com/docs/handbook-permissioning/index.md) are currently applied — AdapTable does not show menu items for _Hidden_ entitlements
