POST Working, But Not Updating File

佐手、 提交于 2020-01-06 10:00:05

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!