1

我有以下情况,我正在尝试将工具栏 ( Ext.toolbar.Toolbar) 添加到网格 ( Ext.panel.grid) 中。网格Ext.window.Window位于我的主 app.js 中的 a 内部,看起来像这样:

Ext.application({
    name: 'FileBrowser',
    appFolder: '/Scripts/dashboard/FileBrowserApp',
    controllers:['BrowserController'],
    launch: function() {
    win = Ext.create('Ext.window.Window', {
        title: 'Document Library',
        width: 700,
        height: 500,
        layout: 'border',
        bodyStyle: 'padding: 5px;',
        items: [
            {
                xtype:'tree_dir'
            },
            {
                xtype:'grid_file',
            }

        ]
    });
    win.show();
}
 })

我的问题是,我该怎么做?我是否在控制器中动态添加工具栏?如果是这样,我如何grid_file从控制器访问上述内容?我应该以某种方式将它添加到我的grid_file视图中吗?那么如何访问工具栏视图?

4

1 回答 1

2
   myPanel.addDocked({
        xtype: 'toolbar',
        dock: 'top',
        items:[
            {
                xtype:'button',text:'Open Win1',ref:'win1Button'
            },{
                xtype:'button',text:'Open Win2',ref:'win2Button'
            }]
        });
于 2012-12-13T21:28:44.797 回答