Customizable Header Menu Items
Applications can add, remove, reorder or replace header menu items with a callback that receives the column context. Domain actions such as 'Copy column' or 'Show statistics' can then live alongside the built-in actions.
Planned. This page shows the specification from issue #185. The live example, source for every framework and the API reference replace it when the feature ships.
Live example
A grid whose numeric columns have a custom 'Show statistics' item that opens a small dialog.
Expected behavior
The callback runs on each menu open with the column and the default items. The returned list is rendered exactly as returned. Custom actions receive the column and grid API.
Planned API surface
gridOptions.getHeaderMenuItems(params)params.defaultItemsmenuItem.idmenuItem.labelmenuItem.iconmenuItem.actionmenuItem.disabledmenuItem.childrenmenuItem.separatorAcceptance criteria
- The callback receives the column, the group (if any) and the default items. (pending)
- The returned items render in the returned order. (pending)
- An empty returned array hides the menu button for that column. (pending)
- A custom item with disabled=true renders with aria-disabled. (pending)
- Exceptions thrown by the callback fall back to the default items and log an error in dev mode. (pending)