DeclanMcD
DeclanMcD

Reputation: 1586

Setting filters in ui-grid doesn't work

I am trying to set the filter in ui-grid pragmatically but doesn't seem to work with ranges.

This plunkr shows one of the filters working perfectly (the name). But the age filter populates the input box but doesn't appear to update the grid's filter. Do I have to manually update the filter?

I have also tried setting the entire filter when the button is clicked by:

$scope.ageColumn.filters=$scope.ageFilter;

but that also doesn't work.

Any idea how to get this to work?

Upvotes: 1

Views: 1052

Answers (1)

PaulL
PaulL

Reputation: 6650

Looks like we need the term to be a string - when it's a number it doesn't work.

$scope.ageColumn.filters[0].term='30';

http://plnkr.co/edit/2TvIqdKYeRuYXUx1bRNo?p=preview

Not sure why that would be the case, so I need to take a look at that.

Upvotes: 2

Related Questions