PDA

View Full Version : how to use filterby for multiple values



Ash2009
25 Apr 2011, 9:01 PM
I need to filter a store with multiple values.The values are random "strings" or "ids" inside an array.
I am using filterby but it filters out all the values from that store.
I have written a similar sample code, donno where is it going wrong ? please help.

var arr = ["abc","xyz","dfgh","tery"];

store.filterBy(function(record){
for(var i=0;i<arr.length;i++){
if(record.get('code') != arr[i])
return false;
}
});