Column Menu Technical Reference

View as Markdown

Column Menu Options

customColumnMenu receives a CustomColumnMenuContext:

CustomColumnMenuContext

Context info provided when building Custom Column Menus

Extends

ColumnMenuContext<TData>

Flat list of all available AG Grid Menu Items

defaultAgGridMenuStructure

(AgGridMenuItem<AgGridColumnMenuItemType> | { menuType: 'Group'; label: string; subMenuItems:AgGridMenuItem<AgGridColumnMenuItemType>[]; disabled?: boolean; icon?:AdaptableIcon; })[]

Default structure of AG Grid Menu Items

Custom application Context provided in AdaptableOptions.adaptableContext

A menu entry the user supplies is a UserColumnMenuItem:

UserColumnMenuItem

Column Menu Item that is provided by User

disabled?

boolean

Whether menu item is disabled

Optional Framework Component (React, Angular or Vue) used to render the
content of this menu item.

When supplied, AG Grid renders the component inside the menu row using
its own framework adapter. The component receives AG Grid's
CustomMenuItemProps, with the AdapTable-specific extras
(adaptableApi, menuContext, plus anything passed via
menuItemParams) available as props.menuItemParams.

Supported in the React, Vue and Angular variants of AdapTable.

For Vue, supply a factory that returns the Vue Component (NOT a render
call), e.g. ({ adaptableApi }) => MyMenuItem. AG Grid Vue then
instantiates the component using its own framework adapter and passes
name, icon, menuItemParams, ... as props.

For Angular, supply { type: MyMenuItemComponent } where the component
implements IMenuItemAngularComp (with agInit(params) to receive
params.menuItemParams.adaptableApi and params.menuItemParams.menuContext).
The onSetup callback on AngularFrameworkComponent is NOT honoured
for menu items because AG Grid owns the component lifecycle.

hidden?

boolean

Whether menu item is hidden

Optional icon to display

label

string

Text to appear in the Menu Item

onClick?

(menuContext:ColumnMenuContext) => void

Function invoked when the Menu Item is clicked

Column Menu API

ColumnMenuApi

The menu opened from a column header.