0
votes

I have a Backbone Model that has Backbone Collections for some of its attributes.

When a change event is triggered on one of these collections, it does not propagate to the parent model.

Is it possible to change this, so that the event does propagate?

1
It's the other way round, model change events trigger collection change event. If you don't like the way answer by metadept is the solution - Deeptechtons

1 Answers

3
votes

Provided you're not referencing a collection that the model's part of (which would create circular logic), you should be able to bind it explicitly:

model.listenTo(model.collection, 'change', function() {
        model.trigger('change');
    });

Here's a jsFiddle that seems to be working: http://jsfiddle.net/2Nctk/2/