SegFaultDev
SegFaultDev

Reputation: 583

Does a CollectionView's childView have to be an ItemView?

I am trying to get a final layout like...

but my Left Column (collectionView) does not want to show the panelLayout(LayoutView). Is it possible to have a childView: that is a LayoutView (like the example below) and not a ItemView (http://marionettejs.com/docs/v2.4.2/marionette.collectionview.html#collectionviews-childview)

class panelLayoutView extends Marionette.LayoutView
template: Templates['panel']

regions:{

    bannerRegion: "#banner-region"
    contentRegion: "#content-region"
}



class leftColumnCollectionView extends Marionette.CollectionView
    className: "leftColumn column"
    childView: panelLayoutView
    childViewContainer: "leftColumn"

Upvotes: 1

Views: 268

Answers (1)

Andrew Hubbs
Andrew Hubbs

Reputation: 9426

Yes. There is absolutely nothing wrong with using a LayoutView or any other Marionette view type as the childView for a CollectionView.

Upvotes: 0

Related Questions