ashish
ashish

Reputation: 332

how to disable sorting and filtering for specific columns in aggrid

I want to disable sorting and filtering for specific columns in ag-grid.

Code that i have :

const columnDefs: any =
      [
        {
          headerName: "Name", field: "name", sort: 'asc'
        },
        { headerName: "Age", field: "age" },
        {
          headerName: "Active", field: "isActive", cellRendererFramework: MyCheckboxComponent
        }

];

this.gridOptions = {
      columnDefs: columnDefs,
      enableSorting: true,
      enableFilter: true,
}

In this i want to disable sorting for active column. I tried the below code but it didnt help.

headerName: "Active", field: "isActive",enableSorting:false,enableFilter:false, cellRendererFramework: MyCheckboxComponent

but the above code didn't help.

Upvotes: 2

Views: 1096

Answers (1)

ashish
ashish

Reputation: 332

Got it solved by adding suppressMenu: true,suppressSorting: true, which solved my issue. Thanks

Upvotes: 2

Related Questions