well, if you first create a formpanel, and load a tabpanel in its items. At the same time, you new another formpanel, and add it to the tab ot this tabpanel. You can find there is no export in the tab of tabpanel. My code is below. If you chage the red color char to Panel or Window, everything is OK.
Code:
test = {
dataRecord: ['text'],
urlSave: 'tabpanel.html',
createDialog: function() {
var reader = new Ext.data.JsonReader({}, this.dataRecord);
this.formPanel = new Ext.form.FormPanel({
defaultType: 'textfield',
labelAlign: 'right',
labelWidth: 70,
frame: true,
autoScroll: true,
title: '详细信息',
reader: reader,
url: this.urlSave,
items: [{
xtype: 'hidden',
name: 'id'
},{
fieldLabel: '姓 名',
//readOnly:true,
name: 'name',
allowBlank: false,
width: 200
}],
buttons: [{
text: '确定',
handler: function() {
if (this.formPanel.getForm().isValid()) {
this.formPanel.getForm().submit({
waitTitle: "请稍候",
waitMsg : '提交数据,请稍候...',
success: function() {
this.dialog.hide();
this.refresh();
},
failure: function() {
},
scope: this
});
}
}.createDelegate(this)
},{
text: '取消',
handler: function() {
this.dialog.hide();
}.createDelegate(this)
}]
});
var tabs = new Ext.TabPanel({
title:'tab',
//renderTo: document.body,
height: 500
});
tabs.add({
title: '基本信息',
// html: 'http://#'
deferredRender:false,
items:[this.formPanel]
});
tabs.add({
title: '业务水平',
html: '内容2'
// closable: true
});
tabs.activate(0);
this.dialog = new Ext.form.FormPanel({
layout: 'fit',
width: this.dlgWidth ? this.dlgWidth : 400,
height: this.dlgHeight ? this.dlgHeight : 400,
//closeAction: 'hide',
items: [tabs]
});
}
};
Ext.onReady(function(){
test.createDialog();
test.dialog.render(document.body);
});