ExtJS 4 - 如何在面板标题栏中添加项目?

4

我希望将Ext.button.Split添加到面板的标题栏中,而不是标题。它必须像面板内容和标题的开关按钮一样。在extjs 4中有什么选项可以做到这一点吗?或者,有没有更好的解决方案来代替Split button?不幸的是,在面板头部的开关按钮是主要要求,所以它必须放在那里。

2个回答

10

以下方法适用于我使用的ExtJs 4.2.2版本。

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

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

                    }
                ]
            }
}

5
使用工具将标题对象添加到面板中,并为按钮添加项目。
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'
        }]
    }
});

哎呀..Peter Li跑得有点快 :/ - Guilherme Lopes
可能是因为我输入的比你少 :) - Peter Li

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接