Configuring the Column Menu
Summary
- Developers have full control over the Column Menu including the ability to:
- reorder Menu Items
- restructure Menu Items
- remove Menu Items
The Column Menu can be fully configured at design-time to meet users' requirements.
This is done via the customColumnMenu function property in Column Menu Options.
The property is a function that receives, in its context, all the information about the AG Grid and AdapTable Column Menu items and structure, to facilitate full menu manipulation.
Deep Dive
Configuring the Column Menu using the customColumnMenu property
Reordering Menu Items
The default order of the Items in the Column Menu is AG Grid Menu items first, then AdapTable Menu items.
But the menu can be re-ordered by providing a custom implementation of customColumnMenu.
- This example shows how to reorder the Menu Items in the Column Menu
- When opening the Column Menu in the
Namecolumn, the order is: AG Grid Menu Items,Open Settings Panel, other AdapTable Menu Items - When opening the Column Menu in all other columns, the order is:
Open Settings Panel, AG Grid Menu Items, other AdapTable Menu Items
Expand to see the Menu Options configuration
- Open the Column Menu for a cell in the
NameColumn and see how it differs to opening the Column Menu in other Columns
Restructuring Menu Items
The customColumnMenu property can also be used restructure the Menu Items in line with user requirements.
For instance, menus can be grouped or nested differently to the default structure provided by AdapTable.
- This example shows how to restructure the Menu Items in the Column Menu
- In each Column Menu, all the AG Grid items have been grouped together into one Menu Item (and placed first)
- Additionally, some of the AdapTable items have been grouped together in 'Info' and 'Actions' sub menus
Expand to see the Menu Options configuration
Removing Menu Items
The customColumnMenu property can also be used to remove some Menu Items from the Column Menu.
Removing Menu Items can be done in 2 ways:
- Hiding an entire section of the Column Menu (either AdapTable or AG Grid)
- Hiding particular Column Menu Items
- This example hides specific Menu items from some Column Menus:
Namecolumn displays only theSettings Panel& (the 5)Layoutrelated itemsGithub Starsdisplays only the AdapTable itemsGithub Watchersdisplays only the AG Grid items- For all other columns, the default Column Menu items are displayed
Expand to see the Menu Options configuration
Row-Grouped Columns
The ColumnMenuObject used in the Column Menu includes an isRowGroupColumn property.
This can be used to provide specific Column Menu Items for Row-Grouped Columns.
- This example hides all AG Grid Menu items in Row Grouped Column's Column Menu other than 3:
Un-Group All,Expand All Row Groups&Collapse All Row Groups