Is there a way to add a column filter for empty values? I see we can filter for equal, not equal, ... but I'd like to have an option to filter a column so it returns rows where the column is empty or null.
I had the same issue with empty cells You should use 'Blank option'
const filterOptions = [
'empty',
{
displayKey: 'blanks',
displayName: 'Blanks',
test: function (filterValue, cellValue) {
return cellValue == undefined;
},
hideFilterInput: true,
},
'equals',
'notEqual',
'lessThan',
'lessThanOrEqual',
'greaterThan',
'greaterThanOrEqual',
'inRange'
];
columnDef = [
{
headerName: 'someValue', field: 'someValue',
filter: 'agNumberColumnFilter',
filterParams: {
filterOptions: filterOptions
}
},]
'empty' - is equal to 'Please choose option'
more inforamtion you can find here: https://www.ag-grid.com/javascript-grid-filter-provided-simple/#blank-cells-date-and-number-filters
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With