0

I want to expose some attributes from relational model (builded via backbone-relational) to my backgrid (builded via backgrid.js). As I understand backgrid receives collection and mapped model as columns object. So I need to change model when the model initialised, e.g. something like:

initialize: function() {
  this.fetchRelated('myRelatedModel');
  this.set({relatedName:this.get('myRelatedModel').get('name')});
}

The problem is that when I do this, my model receives 'changed' state. But I don't want to change model, I only want to expose related model's attributes to my backgrid.

What should I do?

Integral
  • 115
  • 1
  • 8

1 Answers1

0

JavaScript

this.set({relatedName:this.get('myRelatedModel').get('name')}, {silent: true});
Derek 朕會功夫
  • 92,235
  • 44
  • 185
  • 247
Y.H Wong
  • 7,151
  • 3
  • 33
  • 35