1
votes

I am using ExtJs 4.1. I have a store which is having a model. Model contains three fields ID, Name, age. This store is attached to a grid.

This is how the data looks:

enter image description here

I user filter function on the store to apply filter.

So when i apply filter on Id 'Manu', i see two results in grid myStore.filter('ID', 'Manu'); //Works fine

Problem myStore.filter('ID', 'Sales'); // retuns 4 results. It also includes result for ID 'Sales One' and 'Sales Two'

What I Want: When I filter on 'Sales' ID, it should return only results for ID 'Sales'.

1

1 Answers

4
votes
myStore.filter([
   {filterFn: function(item) { return item.get('ID') == 'Sales'; }}
]);