EXTJS工具栏和按钮放置帮助需要



我是EXT JS的新手,我试图创建一个工具栏并添加一些按钮。

我遵循EXTJS边界布局技术,我有窗体在视窗的中心。现在我想将按钮添加到viewport的上角,在本例中是north Region。我知道如何生成按钮和工具栏,但不知道如何渲染所需的区域。

下面是我生成的示例代码:
Ext.onReady(function () {
    new Ext.Toolbar({
        items: [{
            xtype: 'tbbutton',
            text: 'Button'
        }, {
            xtype: 'tbbutton',
            text: 'Menu Button',
            menu: [{
                text: 'Better'
            }, {
                text: 'Good'
            }, {
                text: 'Best'
            }]
        }, {
            xtype: 'tbsplit',
            text: 'Split Button',
            menu: [{
                text: 'Item One'
            }, {
                text: 'Item Two'
            }, {
                text: 'Item Three'
            }]
        }]
    });
});

我想我需要帮助使用renderTo关键字,但我不知道如何使用。

在viewport的items配置中添加一个面板,该面板的tbar配置为:

items: [
    new Ext.Panel({
        region: 'north',
        tbar: ['->', YOUR_TOOL_BAR]
    })
  ....
]

最新更新