Store do something after sync with autoSync enabled

后端 未结 3 1342
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-15 01:45

I\'m trying to detect and remove those fields that after a sync are still on the store but are not added to the database (success: false). Then, return an error message to t

3条回答
  •  执笔经年
    2020-12-15 02:16

    Another way to get around this is to use suspendAutoSync and resumeAutoSync methods of the store and then manually sync (Ext JS > 4.1.0):

    store.suspendAutoSync();
    store.insert(0, record);
    store.sync({
       success: function (batch, options) {
          // do something
       },
       failure: function (batch, options){
          // handle error
       }
    });
    store.resumeAutoSync();
    

提交回复
热议问题