bstras21
22 Dec 2011, 8:18 AM
Hello, I am lopping a store to find a record and I can't seem to get it working correctly:
me.offlineStore.load();
Ext.Array.each(loadRecords, function(name, index) {
var count = index + 1;
if(!me.offlineStore.findRecord('ID', count)){
console.log('record DOES NOT exists'+ count);
}else{
console.log('record exists'+ count);
}
});
Now when I check my log (No data is in the store yet) I get this:
record DOES NOT exists1Store.js
:30record DOES NOT exists2Store.js
:30record DOES NOT exists3Store.js
:34record exists4Store.js
:30record DOES NOT exists5Store.js
:30record DOES NOT exists6Store.js
:30record DOES NOT exists7Store.js
:30record DOES NOT exists8Store.js
:30record DOES NOT exists9Store.js
:30record DOES NOT exists10Store.js
:30record DOES NOT exists11Store.js
:30record DOES NOT exists12Store.js
:30record DOES NOT exists13Store.js
:30record DOES NOT exists14Store.js
:30record DOES NOT exists15Store.js
:30record DOES NOT exists16Store.js
:30record DOES NOT exists17Store.js
:30record DOES NOT exists18Store.js
:30record DOES NOT exists19Store.js
:30record DOES NOT exists20Store.js
:34record exists21Store.js
:30record DOES NOT exists22Store.js
:30record DOES NOT exists23Store.js
:30record DOES NOT exists24Store.js
:30record DOES NOT exists25Store.js
:34record exists26Store.js
:30record DOES NOT exists27Store.js
:30record DOES NOT exists28Store.js
:30record DOES NOT exists29Store.js
:30record DOES NOT exists30Store.js
:30record DOES NOT exists31Store.js
:30record DOES NOT exists32Store.js
:30record DOES NOT exists33Store.js
:34record exists34Store.js
:30record DOES NOT exists35Store.js
:30record DOES NOT exists36Store.js
:30record DOES NOT exists37Store.js
:30record DOES NOT exists38Store.js
:30record DOES NOT exists39Store.js
:30record DOES NOT exists40Store.js
:30record DOES NOT exists41Store.js
:34record exists42Store.js
:30record DOES NOT exists43Store.js
:30record DOES NOT exists44Store.js
:30record DOES NOT exists45Store.js
:30record DOES NOT exists46Store.js
:34record exists47Store.js
:30record DOES NOT exists48Store.js
:30record DOES NOT exists49Store.js
:30record DOES NOT exists50Store.js
:30record DOES NOT exists51Store.js
:34record exists52Store.js
:34record exists53Store.js
:34record exists54
I'm not sure what I'm doing wrong? Records should not be existing (I've removed the store many times and ran is with the same results). Should I be using a different method to check a store for a record? Thanks!
me.offlineStore.load();
Ext.Array.each(loadRecords, function(name, index) {
var count = index + 1;
if(!me.offlineStore.findRecord('ID', count)){
console.log('record DOES NOT exists'+ count);
}else{
console.log('record exists'+ count);
}
});
Now when I check my log (No data is in the store yet) I get this:
record DOES NOT exists1Store.js
:30record DOES NOT exists2Store.js
:30record DOES NOT exists3Store.js
:34record exists4Store.js
:30record DOES NOT exists5Store.js
:30record DOES NOT exists6Store.js
:30record DOES NOT exists7Store.js
:30record DOES NOT exists8Store.js
:30record DOES NOT exists9Store.js
:30record DOES NOT exists10Store.js
:30record DOES NOT exists11Store.js
:30record DOES NOT exists12Store.js
:30record DOES NOT exists13Store.js
:30record DOES NOT exists14Store.js
:30record DOES NOT exists15Store.js
:30record DOES NOT exists16Store.js
:30record DOES NOT exists17Store.js
:30record DOES NOT exists18Store.js
:30record DOES NOT exists19Store.js
:30record DOES NOT exists20Store.js
:34record exists21Store.js
:30record DOES NOT exists22Store.js
:30record DOES NOT exists23Store.js
:30record DOES NOT exists24Store.js
:30record DOES NOT exists25Store.js
:34record exists26Store.js
:30record DOES NOT exists27Store.js
:30record DOES NOT exists28Store.js
:30record DOES NOT exists29Store.js
:30record DOES NOT exists30Store.js
:30record DOES NOT exists31Store.js
:30record DOES NOT exists32Store.js
:30record DOES NOT exists33Store.js
:34record exists34Store.js
:30record DOES NOT exists35Store.js
:30record DOES NOT exists36Store.js
:30record DOES NOT exists37Store.js
:30record DOES NOT exists38Store.js
:30record DOES NOT exists39Store.js
:30record DOES NOT exists40Store.js
:30record DOES NOT exists41Store.js
:34record exists42Store.js
:30record DOES NOT exists43Store.js
:30record DOES NOT exists44Store.js
:30record DOES NOT exists45Store.js
:30record DOES NOT exists46Store.js
:34record exists47Store.js
:30record DOES NOT exists48Store.js
:30record DOES NOT exists49Store.js
:30record DOES NOT exists50Store.js
:30record DOES NOT exists51Store.js
:34record exists52Store.js
:34record exists53Store.js
:34record exists54
I'm not sure what I'm doing wrong? Records should not be existing (I've removed the store many times and ran is with the same results). Should I be using a different method to check a store for a record? Thanks!