マリオネットに異なるアイテム ビューを含む複合ビューを作成することは可能ですか? 例えば:
var myCompositeView = Backbone.Marionette.CompositeView.extend({
template: Handlebars.compile(myTemplate),
itemView: myView, // I want different views, not just myView
initialize: function(){
this.collection = this.model.views;
},
appendHtml: function(collectionView, itemView){
collectionView.$('.container').append(itemView.el);
}
});
基本的に、コレクションのモデルによって、特定のビューを作成したいと考えています。