【发布时间】:2010-12-09 05:34:01
【问题描述】:
这是一个新手问题。希望这个例子可以教育我自己和其他人以及解决我的问题。
我有一个与 EXTJS 复杂布局示例非常相似的 EXTJS 布局。 TabPanel 是此布局的中心部分。其中一个选项卡呈现一个显示一些数据的 GridPanel。我想点击表格中的编辑图标并打开一个单独的选项卡进行编辑。
这是我的问题:
var t = Ext.getCmp('main-tab-panel');
感谢您对此的任何帮助......
// file: view_main.js
var mainTabPnl = new Ext.TabPanel({
region: 'center',
id: 'main-tab-pnl',
deferredRender: false,
activeTab: 0,
items: [{
contentEl: 'center2',
//id: 'center2', /*!!! screen goes haywire!! why? !!!*/
title: 'Main Panel',
autoScroll: true
}, {
contentEl: 'center1',
title: 'Close Me',
closable: true,
autoScroll: true
}]
})
// file: grid.js
var columns = [{
// Column Headers
//...
},{
header: 'Actions',
id: 'actions',
xtype: 'actioncolumn',
width: 50,
items: [{
icon : '/site_media/icons/application_edit.png',
tooltip: 'Edit Record',
handler: function(grid, rowIndex, colIndex) {
alert("Add-Tab "); // The alert works..
/* but mainTabPnl is not defined */
mainTabPnl.add({
title: 'New Tab',
iconCls: 'tabs',
html: 'Tab Body <br/><br/>',
closable:true
}).show();
}
}];
}];
【问题讨论】:
标签: javascript ajax extjs