Serhii Andronik
Serhii Andronik

Reputation: 88

setFilterModel doesnt perform filtering if filter is {type: 'equals' and filter: ''}

I am truing to use:

gridOptions.api.setFilterModel(filterModel);

with

var filterModel = { country: { type: 'equals', filter: '' } };

So i expect grid will return all rows with empty ''country'', but it looks like grid ignores passed filter with filter: ''

I also tried [null] as a values:

filterModel = { country: { type: 'equals', filter: [null] } };

in this case i see filter indicator near colunm header but rows is the same

maybe i missed something in documentation...

here is example https://plnkr.co/edit/aA7D4At58yg7AqwD1qxc?p=preview

maybe someone can say how to perform filterig on blank values

Upvotes: 2

Views: 4460

Answers (3)

Pratik Bhat
Pratik Bhat

Reputation: 7614

As a work around, we replace empty values with a single space “ “ before populating the grid.
Then you can filter on using the usual setFilterModel to filter out rows with single space.

Hope this helps!

Upvotes: 0

Serhii Andronik
Serhii Andronik

Reputation: 88

right now its not posible with agGrid hope they will add this soon https://github.com/ag-grid/ag-grid/issues/2712

Upvotes: 0

Alberto Gutierrez
Alberto Gutierrez

Reputation: 1588

Have a look at this github issue

https://github.com/ag-grid/ag-grid/issues/2712

Hope this helps

Upvotes: 1

Related Questions