私は次のCompositeView(1)を持っています。
MyCollectionの各モデルについて、そのようなものを作成するために2つのテンプレートとビューをレンダリングするための最良の方法は何でしょうか(2)。
(1)
var MyCompositeView = Marionette.CompositeView.extend({
template: myTemplate,
itemView: myView,
collection: new MyCollection(),
initialize: function () {
this.collection.fetch();
},
appendHtml: function (collectionView, itemView) {
collectionView.$el.find('ul').append(itemView.el);
}
});
(2)
appendHtml: function (collectionView, itemView1, itemView2) {
collectionView.$el.find('ul').append(itemView1.el);
itemView.$el.append(itemView2.el);
}