本文介绍了做了的CollectionView的childView必须是一个ItemView控件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想获得最终的布局像...
- 左栏(的CollectionView)
- PanelLayout(LayoutView)
- BannerView(ItemView控件)
- 内容查看(LayoutView)
- SECTION1(CompositeView中)
- gridRow(ItemView控件)
- SECTION1(CompositeView中)
- PanelLayout(LayoutView)
- BannerView(ItemView控件)
- 内容查看(LayoutView)
- SECTION1(CompositeView中)
- gridRow(ItemView控件)
- SECTION1(CompositeView中)
- PanelLayout(LayoutView)
但我的左侧列(的CollectionView)不希望显示panelLayout(LayoutView)。是否有可能有一个childView:这是一个LayoutView(如下面的例子),而不是一个ItemView控件(的)
类panelLayoutView扩展Marionette.LayoutView
模板:模板['板']地区:{ bannerRegion:#条幅区域
contentRegion:#内容区域
}类leftColumnCollectionView扩展Marionette.CollectionView
产品类别:leftColumn栏
childView:panelLayoutView
childViewContainer:leftColumn
解决方案
是的。我们绝对没有错用 LayoutView
或任何其他木偶视图类型为 childView
为的CollectionView
。
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"
解决方案
Yes. There is absolutely nothing wrong with using a LayoutView
or any other Marionette view type as the childView
for a CollectionView
.
这篇关于做了的CollectionView的childView必须是一个ItemView控件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!