Skip to main content

grid-pro.getactionsmenudef

Home > @genesislcap/grid-pro > getActionsMenuDef

getActionsMenuDef() function

Helper function to get ColDef https://www.ag-grid.com/javascript-data-grid/column-properties/ for Actions Menu Renderer. Will take the parameter values for a base ColDef and merge them with the overrideDef (if specified).

Signature:

getActionsMenuDef: (actions: ActionMenuItem[], overrideDef?: ColDef, customActionsOpenerName?: string, isVertical?: boolean, buttonAppearance?: string) => ColDef

Parameters

Parameter

Type

Description

actions

ActionMenuItem[]

Array of to be displayed in the menu.

overrideDef

ColDef

(Optional) Optional override for the ColDef. Will override any of the default values. Default is an empty object.

customActionsOpenerName

string

(Optional) Optional custom name for the button that opens the menu. Default is '⋮'.

isVertical

boolean

(Optional) Optional flag to display the menu vertically. Default is false (displays the menu horizontally, follow the rowHeight).

buttonAppearance

string

(Optional) Optional appearance for the button that opens the menu. Default is 'outline'.

Returns:

ColDef

Merged ColDef (base ColDef created from the parameters + overrideDef) for Actions Menu Renderer.

Example

public exampleActionsMenuDef: ColDef = getActionsMenuDef(
[
{
name: 'View',
callback: (rowData) => logger.debug('VIEWW!!!', rowData),
},
{
name: 'Delete',
callback: (rowData) => logger.debug('DELETE!!!', rowData),
},
],
{
headerName: 'Instrument Actions',
width: 180,
},
'+',
true,
'primary-gradient'
);