0
votes

I am using ag-grid-enterprise.js version 24.0.0, and this problem also exists in version 23.0.0. If the columnDefs headerName is different than the field, then the column is not selected by default in the ag-grid Columns Tool Panel. Is there a way around this?

Here is my configuration:

gridOptions = {
   columnDefs: [
      enablePivot: true,
      enableRowGroup: true,
      field: 'retail_env',
      headerName: 'Retail Environment'
   ],
   sideBar: true,
   pivotMode: true,
   pivotPanelShow: 'always'
}

When headerName is the same as field, the column IS selected properly in the columns tool panel.

This looks like a bug in ag-grid, but I can't tell for sure.

I would appreciate any help you might have!

1
can you provide sample code to reproduce this? also make sure defaultColDef doesn't have hide property set to true - sandeep joshi

1 Answers

0
votes

While trying to create the sample code to recreate the problem (Thanks, @sandeep joshi!), I found the problem in my application. There is no problem with ag-grid in this area.

The problem was that I was not calling setRowGroupColumns() with the headerName's instead of the field's. The correct code is:

gridOptions.columnApi.setRowGroupColumns(['retail_env'])