Trigger backbone.js change when value doesn't change

后端 未结 2 634
鱼传尺愫
鱼传尺愫 2021-02-12 21:59

It\'s a known feature of backbone.js that when you set data that hasn\'t changed it won\'t fire the change event, nor will it go through validations. I however need the change e

2条回答
  •  孤街浪徒
    2021-02-12 22:31

    this.model.set({fieldErrors: JSONResponse}, {silent:true});
    this.model.trigger('change:fieldErrors');
    

    see this conversation:

    Can I force an update to a model's attribute to register as a change even if it isn't?

提交回复
热议问题