为什么记录会通过调用 POST/Create 操作的 rest 代理成功保存,然后在后续保存时调用相同的 POST/Create 方法而不是 PUT/Update 方法?
帖子
var ref = beginQuestionnaireControl.getPegfileRef();
var Pegfile = Ext.create('Pegfect.model.Pegfile', {
Id: 0,
Reference: ref
});
Pegfile.save({
scope: this,
success: function (pegfile, operation) {
this.activePegfile = pegfile;
this.startQuestions();
},
failure: function () {
alert('That ref is not unique');
}
});
还有 POSTS(期待一个 PUT)
this.activePegfile.save({
success: function () {
successCallback();
},
failure: function () {
alert('oops, error saving Pegfile');
}
});
代理人
proxy:
{
type: 'rest',
url: 'Pegfile',
timeout: 120000,
noCache: false,
reader:
{
type: 'json',
root: 'data',
successProperty: 'success'
},
writer:
{
type: 'json',
writeAllFields: true
}
}