做了的CollectionView的childView必须是一个ItemView控件? [英] Does a CollectionView's childView have to be an ItemView?

查看:233
本文介绍了做了的CollectionView的childView必须是一个ItemView控件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想获得最终的布局像...


  • 左栏(的CollectionView)

    • PanelLayout(LayoutView)

      • BannerView(ItemView控件)

      • 内容查看(LayoutView)

        • SECTION1(CompositeView中)

          • gridRow(ItemView控件)




    • PanelLayout(LayoutView)

      • BannerView(ItemView控件)

      • 内容查看(LayoutView)

        • SECTION1(CompositeView中)

          • gridRow(ItemView控件)





但我的左侧列(的CollectionView)不希望显示panelLayout(LayoutView)。是否有可能有一个childView:这是一个LayoutView(如下面的例子),而不是一个ItemView控件(的http://marionettejs.com/docs/v2.4.2/marionette.collectionview.html#collectionviews-childview)

 类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)
    • 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"

解决方案

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控件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆