PDA

View Full Version : How to put a form variable into a tab panel.



whdanj
18 Mar 2009, 6:16 PM
Hi, I just started to use Ext. Below is my code, i tried to put a form variable into the 1st tab, but why i can NOT see the form in the 1st tab? Thank you very much.



<script>
Ext.onReady(function() {
var form = new Ext.form.FormPanel({
baseCls: 'x-plain',
labelWidth: 55,
url:'save-form.php',
defaultType: 'textfield',

items: [{
fieldLabel: 'Send To',
name: 'to',
anchor:'100%' // anchor width by percentage
},{
fieldLabel: 'Subject',
name: 'subject',
anchor: '100%' // anchor width by percentage
}, {
xtype: 'textarea',
hideLabel: true,
name: 'msg',
anchor: '100% -53' // anchor width by percentage and height by raw adjustment
}]
});

var tabs = new Ext.TabPanel({
renderTo: formContainer,
width:450,
activeTab: 0,
frame:true,
defaults:{autoHeight: true},
items:
[
{
title: '1st Tab',
xtype: 'form',
margins: '13 13 13 6',
items: form,

buttons: [{
text: 'Send'
},{
text: 'Cancel'
}]
}
,{
title: '2nd Tab',
html: 'test'
}
]
});

});
</script>

</head>

<body>
<div id="topContainer">
<div id="formContainer">
</div>
</div>

</body>
</html>

whdanj
18 Mar 2009, 6:20 PM
Thank you very much for your help.