extjs存储保存和异常处理程序

时间:2012-03-26 14:34:10

标签: extjs error-handling store

有没有办法知道内部存储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();

0 个答案:

没有答案