Search code examples
extjsextjs4

ExtJS4 store, filter 1 field by multiple values


Say i have a some store with some data:

id value
1 one
2 two
3 three
4 four

and i'd like to filter it by ID like: store.filter("id", "[1, 4]");

Is it possible? Is there also an another way to get a few values from store by id?


Solution

  • store.filter(function(r) {
        var value = r.get('id');
        return (value == 1 || value == 4);
    });