I have a Marionette.CollectionView that for certain items (models) need to create 2 views to run on the model, can Marionette.CollectionView.buildItemView return 2 views?
EDIT:
I don't want to create some another WrapperItemView, I already have some solution running right now but I want to make it more standart.
I want my code to be look like this, is there a simple way to make it work?
buildItemView: function(item){
// create 2 views based on item type
return [view1, view2];
},
appendHtml: function(collectionView, itemView, index){
if (itemView.type === "X" )
collectionView.$el.find(".A").append(itemView.el);
if (itemView.type === "Y" )
collectionView.$el.find(".B").append(itemView.el);
}