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.
1 Answer
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,
});