javascript - How to retrive value from objects by checking test condition in array -
i have 1 array
filterval = [ab, bc, de];
, millions of record. need check if record.property
value matching of filterval return true
else false.
now problem in code when iterate 2nd index first value washed. can 1 tell me how achive this.
my code.
for(var i=0; i<filterval.length; i++){ grid.store.filterby(function(record){ debugger; if(filterval[i]==record.data[filterproperty]) return true; else return false; }); } **note** : when going i=2; data washed away 1st one.
it looks me you're using extjs, case? if might want tag question.
here's do:
grid.store.filterby(function(record){ return filterval.indexof(record.data[filterproperty]) !== -1 });
Comments
Post a Comment