问题
I am trying to get a final layout like...
- Left Column (collectionView)
- PanelLayout(LayoutView)
- BannerView (ItemView)
- ContentView (LayoutView)
- Section1 (CompositeView)
- gridRow (ItemView)
- Section1 (CompositeView)
- PanelLayout(LayoutView)
- BannerView (ItemView)
- ContentView (LayoutView)
- Section1 (CompositeView)
- gridRow (ItemView)
- Section1 (CompositeView)
- PanelLayout(LayoutView)
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"
回答1:
Yes. There is absolutely nothing wrong with using a LayoutView
or any other Marionette view type as the childView
for a CollectionView
.
来源:https://stackoverflow.com/questions/31465738/does-a-collectionviews-childview-have-to-be-an-itemview