1
votes

I am trying to customize the columnsMenuTab display in ag-grid to hide certain group header rows from being shown. We have a column group hierarchy that looks something like:

Name
  Type Name
    Formula
      Column Name

We'd like to hide the Formulas from being displayed inside the columnsMenuTab so that when the user is toggling the column visibility they don't see the formulas but they can still see the column name. The end result would be something like:

Name
  Type Name
      Column Name

Looking through the documentation (https://www.ag-grid.com/javascript-grid-column-menu/) I was not able to find a way to achieve this customization.

We are using ag-grid-react (enterprise) 21.0.1

Thanks.

05/18 Edit: Added some clarification as to the end result.

1

1 Answers

1
votes

You can use suppressColumnsToolPanel: true for the column you dont want to show up in columnsMenuTab as well as the tool panel that shows up on the right.

This works for column or column group in the hierarchy and should work for Formula column in your case.

As per docs-

suppressColumnsToolPanel Set to true if you do not want this column or group to appear in the Columns Tool Panel. Default: false