Jan 30, 2013, 2:29 PM
indexOf - 2.0 error... Help! I am desperate?!?
I have a store - am performing some summary calculations - for the purposes of this calculation - I need to remove duplicate records with same "PackageID" - I found the below - which apparently works in 1.0 but in 2.0 - I get an error on "indexOf" - I am desperate and need to get this in place ASAP... Any help would be GREATLY appreciated and save my day!
var uniqueIds = store.collect("PackageID");
store.filterBy(function (r) {
var id = r.data.PackageID;
if (uniqueIds.indexOf(id) !== -1) {
uniqueIds.remove(id);
return true;
} else {
return false;
}
});