我有一个如下的模型。
var FolderModel = Backbone.SP.Item.extend({
site: 'CapacityManagement',
list: 'Folder',
parse: function(response) {
var data = {};
if (response.d) {
data.Id = response.d.Id;
data.Active = response.d.Active;
data.FolderName = response.d.FolderName;
data.FolderTypeValue = response.d.FolderTypeValue;
data.ParentFolderID = response.d.ParentFolderID;
}
else {
data.Id = response.Id;
data.Active = response.Active;
data.FolderName = response.FolderName;
data.FolderTypeValue = response.FolderTypeValue;
data.ParentFolderID = response.ParentFolderID;
}
return data;
}
});
我正在尝试更新模型,但它在解析函数中抛出错误。响应变量返回“undefined”。但代码正在创建和删除。
这就是我更新价值的方式。
folder.save({'FolderName': data.FolderName}, {
success: function (model,response,options) {},
error: function (model, response, options) {}
});