2
votes

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?

2

2 Answers

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

store.addFilter({property: 'id', value: [1,4], operator: 'in'});