2

假设我们有以下代码:

Ext.create ( 'Ext.container.Viewport', {
    layout : 'border',
    items  : [{
        region : 'west',
        xtype  : 'panel',
        collapsible : true,
        id     : 'panel1_id',
        width  : '45%'
    }, {
        region    : 'center',
        xtype     : 'panel',
        id        : 'panel2_id',
        width     : '55%'
    }]
});

正如我们所见,第一个面板是可折叠的。我的问题是:折叠时是否可以禁用面板的预览(当我们单击折叠面板的标题时)?

4

1 回答 1

3

不,它没有崩溃。您需要为此进行设置collapsed: true

Ext.create ( 'Ext.container.Viewport', {
        layout : 'border',
        items  : [{
                    region : 'west',
                    xtype  : 'panel',
                    collapsible : true, // this show the tool within the header
                    collapsed: true, // this collapses 
                    floatable: false, // prevent floating on header-click when collapsed
                    id     : 'panel1_id',
                    width  : '45%'
                  },{
                    region    : 'center',
                    xtype     : 'panel',
                    id        : 'panel2_id',
                    width     : '55%'
                  }]
});
于 2013-01-30T09:13:25.610 回答