extjs 怎么向TabPanel中加入一个 FormPanel
蓝翔招生办 2008-05-22 05:17:13 TabPanel的代码如下:
Ext.onReady(function(){
var tabs = new Ext.TabPanel({
renderTo:'tabs',
resizeTabs:true, // turn on tab resizing
minTabWidth: 115,
tabWidth:135,
enableTabScroll:true,
width:584,
height:250,
defaults: {autoScroll:true},
plugins: new Ext.ux.TabCloseMenu()
});
// tab generation code
var index = 0;
while(index < 3){
addTab();
}
function addTab(){
tabs.add({
title: '用户信息 ' + (++index),
iconCls: 'tabs',
html: '表格 ' + (index) + '<br/><br/>'
+ Ext.example.bogusMarkup,
//items: simple,
closable:true
}).show();
}
new Ext.Button({
text: '添加一表格',
handler: addTab,
iconCls:'new-tab'
}).render(document.body, 'tabs');
});
FormPanel的代码如下:
var simple = new Ext.FormPanel({
labelWidth: 60, // label settings here cascade unless overridden
url:'dynamic.html',
frame:true,
title: '',
bodyStyle:'padding:5px 5px 0',
width: 350,
defaults: {width: 230},
defaultType: 'textfield',
items: [{
fieldLabel: '乘机人',
name: 'AirPerson',
allowBlank:false
},{
fieldLabel: '证件类型',
name: 'Id'
},{
fieldLabel: '证件号码',
name: 'IdNo'
}, {
fieldLabel: '国籍',
name: 'country' ,
}, new Ext.form.ComboBox({
fieldLabel: 'State',
hiddenName:'state',
store: new Ext.data.SimpleStore({
fields: ['abbr', 'state'],
data : Ext.exampledata.states // from states.js
}),
valueField:'abbr',
displayField:'state',
typeAhead: true,
mode: 'local',
triggerAction: 'all',
emptyText:'请选择性别...',
selectOnFocus:true,
width:190
}),{
fieldLabel: '出生日期',
name: 'birthday'
},{
fieldLabel: '联系电话',
name: 'telephone'
},{
fieldLabel: '签发地',
name: 'visaAddress'
}
],
buttons: [{
text: '保存'
},{
text: '取消'
}]
});
simple.render(document.body);
我遇到的问题是怎么把这个form 加入到这个table中去,向高手请较!