PDA

View Full Version : form in tabPanel but not show



ives
24 Sep 2008, 5:58 PM
I put a formPanel in tabPanel, but it can't show, even I add show() on formPanel, it can't work,too.



var doUpdate = function(){
basicFrm.getForm().submit({
method: 'POST',
url: 'index.php',
waitTitle: 'member',
waitMsg: 'update...',
success: function(form, action){
var result = Ext.util.JSON.decode(action.response.responseText);
Ext.Msg.alert('message', result.msg);
},
failure: function(form, action){
var result = Ext.util.JSON.decode(action.response.responseText);
Ext.Msg.alert('message', result.msg);
}
});
};
var basicFrm = new Ext.FormPanel({
id: 'basic',
labelWidth:60,
labelAlign:'right',
border: false,
defaults: {width: 230},
defaultType: 'textfield',
items: [{
fieldLabel: 'nickname',
name: 'nickname',
id: 'nickname',
value: '<{$nickname}>'
},{
fieldLabel: 'fullname',
name: 'fullname',
id: 'fullname',
value: '<{$fullname}>'
},{
fieldLabel: 'email',
name: 'email',
id: 'email',
value: '<{$email}>'
},{
xtype: 'hidden',
name: 'id',
value: '<{$id}>'
},{
xtype: 'hidden',
name: 'action',
value: 'update'
},{
xtype: 'hidden',
name: 'controller',
value: 'member'
},{
xtype: 'hidden',
name: 'sub_controller',
value: 'register'
}],
buttons:[{
id:'send',
text:'update',
scope: this,
handler: doUpdate
}]
});
var tabs = new Ext.TabPanel({
renderTo: 'profile',
//width: 450,
//height: 450,
activeTab: 0,
frame: true,
defaults:{autoHeight: true},
items:[{
title: 'basic',
ctCls: 'basic_frm',
layout:'fit',
items: basicFrm
},{
title: 'advanced',
contentEl: 'advanced'
}]
});
});
http://extjs.com/forum/attachment.php?attachmentid=9611&stc=1&d=1222307764

http://extjs.com/forum/attachment.php?attachmentid=9612&stc=1&d=1222307764

the basic tab show nothing, but the advanced tab show the contentEl of <div id='advanced'> normally.
how can I show the form in the tab?

best regards
ives

mjlecomte
24 Sep 2008, 6:31 PM
You've violated the cardinal rule ye shall not overnest read more here:
http://extjs.com/deploy/dev/docs/?class=Ext.Container


items:[
basicFrm,
{
title: 'advanced',
contentEl: 'advanced'
}]