更新的记录与Store.sync()不匹配

时间:2013-04-18 19:38:23

标签: extjs sencha-touch

我在更新商店时遇到了麻烦

Ext.define("ManageShows.model.Show", {
extend: "Ext.data.Model",
config: {
    idProperty: 'id',
    fields: [
        { name: 'id' , type: 'int'},
        { name: 'name', type: 'string' }
    ],
    validations: [
        { type: 'presence', field: 'name', message: 'Please enter a name for this show.'}
    ]
}
});

当我尝试同步()时,我收到此错误

[WARN][Ext.data.Operation#process] Unable to match the updated record that came back from the server. 

包含数据的List然后包含列表中第一个元素的重复条目。但是,如果我刷新页面,我的列表会正确显示更新的术语。

我不知道哪些记录不匹配。唯一不同的是我可以看到Store.id =“ext-record-4”似乎是自动生成的,我没有在数据库中保存这个值,但是Store.data.id = {id from database}。

如何找到不匹配的内容?

编辑: 重要提示是我连续7次得到错误,我有8个条目。如果我更新了第一个条目,则更改会正常显示

1 个答案:

答案 0 :(得分:0)

在sync()调用之后,我停止了我的servlet返回json数据。这不是必需的,因为sencha touch会自动在本地更新数据