1
votes

I have the following situation, I am trying to add a toolbar (Ext.toolbar.Toolbar) to a grid (Ext.panel.grid). The grid is inside of a Ext.window.Window which is in my main app.js looking something like this:

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();
}
 })

My question is, how do I do that? Do I dynamically add the toolbar in the controller? If so how do I access the above grid_file from the controller? Should I somehow add it inside my grid_file view? Then how do I access the toolbar view?

1

1 Answers

2
votes
   myPanel.addDocked({
        xtype: 'toolbar',
        dock: 'top',
        items:[
            {
                xtype:'button',text:'Open Win1',ref:'win1Button'
            },{
                xtype:'button',text:'Open Win2',ref:'win2Button'
            }]
        });