How to disable ag-grid sidebar options

Viewed 899

I am using Ag-grid sidebar and wanted to display all the columns as options to check or uncheck but have some be read-only. I dont have any groups of data. I've been looking through the documentation and it says I need to set functionsReadOnly to tru but that doesnt work

It seems I have to set pivotMode:true but doing so makes all the columns on the grid disappear I want all my columns to show but just have some of the options in the sidebar as disabled. Here is my code

config.js

 { columnDefs: [
    {
      headerName: 'ColA',
      field: 'colA',
    },
    {
      headerName: 'ColB',
      field: 'colB'
      enablePivot: true
    },
    {
      headerName: 'uploadedFiles.fileFormat',
      field: 'formatDescription'
    },
    {
      headerName: 'ColC',
      field: 'colC',
    }
    
  ],
  defaultColDef: {
    sortable: true,
    suppressMenu: false,
    resizable: true,
    suppressColumnsToolPanel: false
  },
  rowSelection: 'single',
  sideBar: {
    toolPanels: [
      {
        id: 'columns',
        labelDefault: 'Columns',
        toolPanel: 'agColumnsToolPanel',
        toolPanelParams: {
          suppressRowGroups: true,
          suppressValues: true,
          suppressPivots: true,
          suppressPivotMode: true,
          suppressSideButtons: true
        }
      }
    ],
    hiddenByDefault: true
  },
  pivotMode:true
}

I want all these columns to show on the grid and the all the options to show in the sidebar...I just want to disable colB but enabling pivot mode makes all the columns disappear on the grid and just using functionsReadOnly on colB doesnt do anything

1 Answers
Related