Is it possible to create a view which lists a collection which is binded to different models? Also can the sort function be used?
For example I have ‘sales’ and ‘accounts’ model and would like to make a view with all the names of the people working in those departments.
Thanks
Sure. What you usually do is end up using a combination of applying event listeners on the collection, creating small subviews which represent each model and binding the model event handlers through that.
So in this example, you basically have your main view that has a collection (e.g. sales). When the sales collection is reset, it fires up the
addAllSales(). Each time an sale is added to the collection we add a subview that represents the specific model (sale model). In this subview, we take care of binding events to the model changes which then do something.