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.

Column Menu: Reordering Menu Items
Fork
  • This example shows how to reorder the Menu Items in the Column Menu
  • When opening the Column Menu in the Name column, 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

Try It Out
  • Open the Column Menu for a cell in the Name Column 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.

Column Menu: Restructuring Menu Items
Fork
  • 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
Column Menu: Removing Menu Items
Fork
  • This example hides specific Menu items from some Column Menus:
    • Name column displays only the Settings Panel & (the 5)Layout related items
    • Github Stars displays only the AdapTable items
    • Github Watchers displays 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.

Column Menu: Row Group Columns
Fork
  • 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

Expand to see the Menu Options configuration