所以我的问题是这个。我可以第一次从本地存储代理中删除记录。但是如果我再做一次,它会给我一个错误,商店中的所有东西都是未定义的,就像它不再存在一样。
onTapRemoveKegelReminder: function(button) {
console.log(button.getData());
//Find and delete the button and the record
var store = Ext.getStore('KegelReminders');
store.load();
store.filter('button_id', button.getData());
var record = store.first();
console.log(record);
console.log(button.getData());
console.log('Remove count'+ store.getCount());
if (typeof record !== 'undefined'||record!=null ) {
store.remove(record);
store.sync();
console.log('removed record correctly')
this.trainingCount--;
var rmButton = this.getKegelExercises().down('#container-' + button.getData());
this.getKegelExercises().remove(rmButton);
}
但是,如果我重新启动我的应用程序,然后再次删除它就可以正常工作。我似乎不能多次删除而不必重新启动应用程序。