0
votes

I have to set default value to ag-grid agTextColumnFilter. I order to do that I I added filterParams and defaultOption, but the filter does't works after my changes.

gridOptions = {
    enableFilter: true,
    ...
    columnDefs: [
        {headerName: "Status", field: "status", filter: "agTextColumnFilter", 
        filterParams: { defaultOption: { notContains: 'default text'} }  }
    ]
}

I am using this documentation. https://www.ag-grid.com/javascript-grid-filter-text/

1

1 Answers

1
votes

Just do this when you are pushing data in ag-grid

columnData.push({
              headerName: "Site Name", 
              field: "siteName",
              dataType: "string",
              enableValue: true,
              filter: "agTextColumnFilter",
              editable: false,
            });