Reputation: 345
I'd like to create a view with Backbone.Marionette that renders a model and then maintains 2 or more CollectionViews. Basically a CompositeView with more than one CollectionView - I'm new to using Marionette, any recommendations on what the best approach would be here?
Thanks!
Upvotes: 2
Views: 1329
Reputation: 4301
you can use a layout to hold and manage your 2 collection views. the main layout will render its own model and template, create the 2 sub views (collectionView or CompositeView).
AppLayout = Backbone.Marionette.Layout.extend({
template: "#layout-template",
regions: {
collection1: "#collection1",
collection2: "#collection2"
}
});
var layout = new AppLayout();
layout.collection1.show(new collection1());
layout.collection2.show(new collection2());
Upvotes: 7