问题
Using BackgridJS (backgridjs.com) and want to be able to update one of the cells and save it to the server. This is the code that they provide us with for this task:
var MyModel = Backbone.Model.extend({
initialize: function () {
Backbone.Model.prototype.initialize.apply(this, arguments);
this.on("change", function (model, options) {
if (options && options.save === false) return;
model.save();
});
}
});
I added this to my code, and ran it on my server using MAMP. I looked at the JavaScript Console to see if my changes worked, and they did. In the Request Payload, it shows my updated code. Unfortunately though, when I refreshed the page, the cells that I updated reverted back to their original text.
Why is this?
来源:https://stackoverflow.com/questions/18435358/post-working-but-not-updating-file