1

当我将 hbox 放置在表格布局中时,项目不可见!

Ext.create('Ext.panel.Panel', {
title: 'Hello',
width: 200,    
layout: {
    type: 'table',
    columns: 9,
},    
items: [
    {
        xtype: 'container',
        layout: 'hbox',
        items: [
            {
                xtype: 'container',
                html: '123',
            },
        ],
    },
],    
renderTo: Ext.getBody()
});

链接:https ://fiddle.sencha.com/#view/editor&fiddle/1q1h

4

1 回答 1

2

解决此问题的一种方法是设置width容器的:

Ext.create('Ext.panel.Panel', {
    title: 'Hello',
    width: 500,

    layout: {
        type: 'table',
        columns: 9,
    },
    items: [{
        xtype: 'container',
        layout: 'hbox',
        width: 100,
        items: [{
            xtype: 'container',
            html: '123'
        }, ],
    }, ],

    renderTo: Ext.getBody()
});

小提琴示例

于 2017-02-10T14:40:58.993 回答