Javascript ExtJS MVC添加工具栏
我遇到以下情况,我正在尝试将工具栏(Javascript ExtJS MVC添加工具栏,javascript,extjs,extjs4,extjs-mvc,Javascript,Extjs,Extjs4,Extjs Mvc,我遇到以下情况,我正在尝试将工具栏(Ext.toolbar.toolbar)添加到网格(Ext.panel.grid)。网格位于我的主app.js中的Ext.window.window内,看起来像这样: Ext.application({ name: 'FileBrowser', appFolder: '/Scripts/dashboard/FileBrowserApp', controllers:['BrowserController'], launch: fu
Ext.toolbar.toolbar
)添加到网格(Ext.panel.grid
)。网格位于我的主app.js中的Ext.window.window
内,看起来像这样:
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\u文件
视图中?那么如何访问工具栏视图
myPanel.addDocked({
xtype: 'toolbar',
dock: 'top',
items:[
{
xtype:'button',text:'Open Win1',ref:'win1Button'
},{
xtype:'button',text:'Open Win2',ref:'win2Button'
}]
});