Extjs sencha touch,sync()desn';成功后,不要将脏标志设置为false

Extjs sencha touch,sync()desn';成功后,不要将脏标志设置为false,extjs,touch,store,Extjs,Touch,Store,这是我的密码: 在控制器中,我在现有记录中设置了一个值: this.record.set('description', 'test'); this.getFlightsList().getStore().sync(); 然后我显式地调用sync()。 我可以通过1个对象看到对服务器的正确调用 {id: 1, description: 'test'} 正确的回答是: {"message":"success","data":[],"returnCode":0,"success"

这是我的密码:

在控制器中,我在现有记录中设置了一个值:

this.record.set('description', 'test');        
this.getFlightsList().getStore().sync();
然后我显式地调用sync()。 我可以通过1个对象看到对服务器的正确调用

{id: 1, description: 'test'} 
正确的回答是:

{"message":"success","data":[],"returnCode":0,"success":true}
但是,如果我尝试编辑另一条记录,每次它都会发送最后一条修改过的记录,因此它会发送一个包含两条不同记录的对象,即当前记录和最后一条记录

   [ {id: 1, description: 'test'}, {id: 2, description: 'test2'}]
等等

事实上,如果我分析存储,我会在最后一条记录(id:1)上看到属性
dirty:true
,但在sync()成功后,它应该是false。(?!)

有什么想法吗

是否我必须将修改后的数据放入响应中?例如:

{"message":"success","data":[{id:1, description:'test'}],"returnCode":0,"success":true}
Tnx

sync()是一个异步函数。尝试在回调中检查您的记录:

this.getFlightsList().getStore().sync({
    callback: function (batch) {

        console.log(batch.operations);// your sync'ed records 

    }
});