I have a main app view, which has 2 subviews. Each subview has its own collection passed to it.
One of these collections is being updated during the user journey. But the subview associated with it is not updating.
How can I make the view re-render once the collection is updated?
As I understand, you are rendering several items, each of which corresponds to one model in your collection. In this case, to take advantage of dynamic inserting/removing of corresponding items, you should use renderCollection
like this in your subview:
render: function(){
this.renderWithTemplate(this);
this.renderCollection(this.collection, ItemView, this.el.querySelector('SELECTOR'));
return this;
}
Here ItemView is the view which corresponds to one model in the collection (it's the constructor, not instantiated view). From this view you have access to this.model
and in this view you can define any bindings and events you might want. For more details check out official documentation.