LoginSignup
1
0

More than 5 years have passed since last update.

DataView を子要素に配置する場合、height を入れておかないと表示されない

Posted at

小一時間ほどはまってしまった。

以下のようなDataViewがあったとする

view/PictureBookDetail.coffee
Ext.define "MyApp.view.PictureBookDetail",
  extend: "Ext.DataView"
  xtype: "picturebookdetail"
  config:
    baseCls: "comment-list"

    itemTpl: 'picture:<tpl for=".">{picture}</tpl>'
view/PictureBookComments.coffee
Ext.define "MyApp.view.PictureBookComments",
  extend: "Ext.DataView"
  xtype: "picturebookdetail"
  config:
    baseCls: "comment-list"

    itemTpl: 'comment:<tpl for=".">{comment}</tpl>'

これを、以下のように配置すると何も表示されない。

controller/Main.coffee
      view = new Ext.Container
          fullscreen: true
          layout: 'card'
          items: [
            xtype: 'panel'
            layoute: 'vbox'
            items: [
              xtype:'picturebookdetail'
              store: pictureStore
            ,
              xtype: 'picturebookcomments'
              store: commentStore
            ]
          ]

      MyApp.Viewport.push view

height をつけてやるとちゃんと表示される

controller/Main.coffee
      view = new Ext.Container
          fullscreen: true
          layout: 'card'
          items: [
            xtype: 'panel'
            layoute: 'vbox'
            items: [
              xtype:'picturebookdetail'
              store: pictureStore
              height: 100
            ,
              xtype: 'picturebookcomments'
              store: commentStore
              height: 100
            ]
          ]

      Ezuko.Viewport.push view
1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0