extjs 4 - 如何将项目添加到面板标题?

时间:2014-10-31 14:48:49

标签: extjs extjs4

我想将Ext.button.Split添加到面板标题而不是标题中。它必须类似于面板的内容和同一面板的标题的切换器。 extjs 4中有没有选项可以做到这一点?或者有更好的解决方案,而不是拆分按钮?不幸的是,面板标题中的切换器是关键要求,因此必须放在那里。

2 个答案:

答案 0 :(得分:8)

以下对我来说是ExtJs 4.2.2

{
            xtype: 'panel',
            ......

            header: {
                titlePosition: 0,
                items: [ 
                    {
                        xtype: 'splitbutton',

                    }
                ]
            }
}

答案 1 :(得分:4)

使用工具将标题对象添加到面板中,并添加按钮项。

Ext.create('Ext.panel.Panel', {
    width: 300,
    height: 200,
    renderTo: Ext.getBody(),
    header: {
        // if you want your button positioned on the right hand side add
        // titlePosition: 0,
        items: [{
            xtype: 'splitbutton',
            text: 'test'
        }]
    }
});