有没有办法知道内部存储onSave事件处理程序之前发生了异常事件? 应该有更好的smth然后解决方案。 THX
var infoStoreOnSaveHandler = function(store, batch, data ){
if(infoStore.isExceptionOccured){
infoStore.isExceptionOccured = false;
return;
}
//here we can do smth usefull
};
infoStore.on("save", infoStoreOnSaveHandler);
//luk: save handler works even if exception occurs - so we have to prevent this!
var infoStoreExceptionHandler = function(misc){
infoStore.isExceptionOccured = true;
};
infoStore.on("exception", infoStoreExceptionHandler);
infoStore.on("load", infoStoreOnLoadHandler);
infoStore.load();