PDA

View Full Version : 2 fieldset in a tab panel



fongus
5 Jan 2011, 2:26 AM
hello,

in my form panel I have a tabpanel, that is composed of two fieldset,
when i rendered my tabpanel I just have my second fieldset, the first one is destroy and i don't know why ?

here is my code


var config={
layout:'form',
url:"ajaxAjoutUser.php",
items:[{
xtype:'tabpanel'
,activeItem:0,
layoutOnTabChange: true

,border:false

,deferredRender:false

// tabs
,defaults:{
layout:'form'
,defaultType:'textfield'
,hideMode:'offsets'
},

items:[{
title:"Info Perso",
xtype: 'fieldset',
checkboxToggle: false,
title: 'Login & mot de passe',
autoHeight: true,
collapsed: false,
defaultType: 'textfield',
items: [{
id: "loginUser",...

},{
id: "mdpUser",
...
}], //end fielset

xtype: 'fieldset',
checkboxToggle: false,
title: 'Informations personnelles',
autoHeight: true,
collapsed: false,
defaultType: 'textfield',
items: [{
id: "nomUser",
...
},
{
id: "prenomUser",
...
},

],//end fieldset
buttons:[{
text:'Créer'
,formBind:true
,scope:this
,handler:this.submit
,buttonAlign:'left'
}]//end button
}]//end tab panel
}]//end formpanel
};//end config


if someone have an idea ??

vishalnnsingh
5 Jan 2011, 2:59 AM
I hope this will work

var config = {
layout: 'form',
url: "ajaxAjoutUser.php",
items: [{
xtype: 'tabpanel',
activeItem: 0,
layoutOnTabChange: true,
border: false,
deferredRender: false,
defaults: {
layout: 'form',
defaultType: 'textfield',
hideMode: 'offsets'
},

items: [
{
title: "Info Perso",
xtype: 'fieldset',
checkboxToggle: false,
autoHeight: true,
collapsed: false,
defaultType: 'textfield',
items: [{
id: "loginUser"
},
{
id: "mdpUser"
}]
},// changes i made
{
//end fielset
xtype: 'fieldset',
checkboxToggle: false,
title: 'Informations personnelles',
autoHeight: true,
collapsed: false,
defaultType: 'textfield',
items: [{
id: "nomUser"
},
{
id: "prenomUser"
}
],
//end fieldset
buttons: [{
text: 'Créer',
formBind: true,
scope: this,
handler: this.submit,
buttonAlign: 'left'
}] //end button
}] //end tab panel
}] //end formpanel
}; //end config
You are setting the title config twice, well that's not the problem over here but still.
I think the problem with your code is that you were not ending the object config properly.

fongus
5 Jan 2011, 4:56 AM
hello and thx for your help,

the change create 2 tabpanel for my 2 fieldset,
and i want my two fieldset in one tab panel.

so i thinck normaly it's possible but here i don't found where is the problem.

vishalnnsingh
5 Jan 2011, 5:23 AM
your items should be a panel then which will contain the fieldset as items. if you still don't get it, then spend sme time with sencha extjs examples.

fongus
5 Jan 2011, 6:24 AM
ok i found my problem,

i forgot one Items in xtype tabpanel.

that's why it didn't work.

thx for help again

vishalnnsingh
5 Jan 2011, 7:39 AM
great