Extjs - 工具栏而不是标题(启用选项可折叠)

时间:2013-06-15 02:31:31

标签: extjs extjs4 extjs4.1 toolbar

我有一个像这样的项目(JSFiddle Demo):

{
    region: 'west',
    title: 'Instead of toolbar',
    collapsible: true,
    width: 250,
    tbar: [{
        xtype: 'button',
        text: 'Button',
        style: {
            background: 'green'
        },
        handler: function() {}
    }]
}

我希望我的tbar代替标题,如(1-> 2)

enter image description here

我试图删除标题,但它不起作用。怎么做谢谢:)。

1 个答案:

答案 0 :(得分:6)

删除标题并将相同的折叠工具添加到工具栏:

{
    region: 'west',
    collapsible: true,
    header: false,
    width: 250,
    tbar: [
        {
            xtype: 'button',
            text: 'Button',
            style: {
                background: 'green'
            },
            handler: function (){}
        },
        '->',
        {
            type: 'left',
            xtype: 'tool',
            handler: function(t) {
                this.up('panel').collapse();
            }
        }
    ]
}