我把节省使用这样的:
console.log(this.model.isNew());
console.log(this.model);
this.model.save({}, {
success: function (model, response, options) {
console.log(response);
},
error: function (model, xhr, options) {
console.log(xhr.result.Errors);
}
});
在isNew()
返回false。 但输出this.model
具有0的ID(this.model.id是0以及)
我的网址是url: ROOTAREA + "/Expenses/Entry/",
更新工作正常,如预期用途PUT。
编辑:这是我的模型的一部分:
defaults: function () {
return {
DocumentDate: "",
JobNo_: "",
PhaseCode: "",
WorkTypeCode: "",
Description: "",
Quantity: 0,
UnitCost: 0,
ExpenseCurrencyCode: "",
ReimbursementCurrencyCode: "",
UnitofMeasureCode: "DIEM",
LineNo_: 0
};
},
idAttribute: "LineNo_",