【发布时间】:2014-05-22 15:02:15
【问题描述】:
我有一个 autosync:true 的商店。
加载商店时,我得到了完整的模型:
[{"id":11,"active":true,"name":"ABC","sens":7,"details":119,"type":13,"acl":false,"create":true,"delete":true,"owner":"alexander","members":"gustave\njerome"}]
在将新模型同步到服务器时,我将使用"id":0 发送它,以便服务器知道它必须创建一个新模型。然后服务器会响应{"success":true,"data":[12],"debug":[]},其中12是新创建条目的id。
现在我必须为 autoSync 操作添加一个回调函数,以将我收到的 id 修补回商店。
如果我手动同步,这会很容易:
Ext.getStore("RightsStore").sync({
success:function() {
}
})
但是我怎样才能获得一个特殊的成功或回调函数,以便将同步插入使用 autoSync 的商店?
【问题讨论】:
标签: extjs extjs4 sync extjs4.2