简体   繁体   English

面板未显示sencha touch 2

[英]panel not displayed sencha touch 2

I have a 'vbox' panel as below, 我有一个如下所示的“ vbox”面板,

 {xtype:'panel',
    id:'srchResPanel',
    layout:'vbox',
    scrollable:false,

    items:[
     {
       xtype:'toolbar',
       docked:'top',
       height:46,
       style:'border-top-left-radius:10px;',
       title:'some title'
         }

    ]}

I am trying to add 2 panels dynamically to the above panel, they are as below 我正在尝试将2个面板动态添加到上面的面板中,它们如下

var header  =  Ext.create('Ext.Panel', {
         height:40,
         width:'100%',

    scrollable: {
        direction: 'horizontal',
        directionLock: true
    },

         layout:'hbox',
     });

    header.setHtml('<div style="font-size:15px;>header</div>');

and

 var grid = Ext.create('Ext.Panel', {
         width:'100%',

    scrollable: {
        direction: 'horizontal',
        directionLock: true
    },
         layout:'vbox',

     });
Ext.getCmp('srchResPanel').add(header);
Ext.getCmp('srchResPanel').add(grid);

when i add the above 2 panels to the top panel, only the first panel(header) is displayed the second panel(grid) is not getting displayed. 当我将上述2个面板添加到顶部面板时,仅显示第一个面板(标题),而第二个面板(网格)未显示。

any help is appreciated. 任何帮助表示赞赏。 thanks in advance. 提前致谢。

您还需要为第二个面板指定height

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM