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

半城伤御伤魂 提交于 2019-12-13 19:16:49

问题


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

  • Left Column (collectionView)
    • PanelLayout(LayoutView)
      • BannerView (ItemView)
      • ContentView (LayoutView)
        • Section1 (CompositeView)
          • gridRow (ItemView)
    • PanelLayout(LayoutView)
      • BannerView (ItemView)
      • ContentView (LayoutView)
        • Section1 (CompositeView)
          • gridRow (ItemView)

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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!