PDA

View Full Version : please help me!about much field post to server(tab in the form)



jeff.panh@gmail.com
20 Oct 2009, 6:38 AM
hi,eveybody,these days i try some way to solve this issue,the code:


Ext.namespace("Ext.ux.bctf");

Ext.ux.bctf.WorkSpace = Ext.extend(Ext.TabPanel,{

initComponent:function(){
Ext.apply(this,{
id:"myWorkSpaces",
region:"center",
xtype:'tabpanel',
activeTab:1,
border:false,
plugins: new Ext.ux.TabCloseMenu(),
items:[
{
title:'Home Page',
closable:false,
html:'home page'
},
/*start*/
{
title:'mytab',
id:'mytab____',
layout:'fit',
closable:true,
items:
{
title:'Packs Info',
border:false,
xtype:'tabpanel',
id:'myGridPanel',
tabPosition:'bottom',
activeTab:0,
frame:false,
items:[
{title:'list',html:'list'},
{
title:'Pack Detail',
border:false,
frame:false,
layout:'fit',
items:{
labelWidth:30,
frame:true,
title: 'Packs',
//padding:t r b l
bodyStyle:'padding:1px 0px 0 0px;',
layout:'table',

layoutConfig:{
columns:3,
columnWidths: [0.33,0.33,0.33]
},
items:[
{
xtype:'form',
items:[
{xtype:'textfield',fieldLabel:'field0',anchor:'100%'}
]
}, {
xtype:'form',

items:[
{xtype:'textfield',fieldLabel:'field1',anchor:'100%'}
]
},{
xtype:'form',
items:[
{xtype:'datefield',fieldLabel:'field2',anchor:'100%'}
]
}
]
}
},
{
title:'Pack Detail-2',
border:false,
frame:false,
layout:'fit',
items:{
labelWidth:30,
frame:true,
title: 'Packs',
//padding:t r b l
bodyStyle:'padding:1px 0px 0 0px;',
layout:'table',

layoutConfig:{
columns:3,
columnWidths: [0.33,0.33,0.33]
},
items:[
{
xtype:'form',
items:[
{xtype:'textfield',fieldLabel:'field3',anchor:'100%'}
]
}, {
xtype:'form',

items:[
{xtype:'textfield',fieldLabel:'field31',anchor:'100%'}
]
},{
xtype:'form',
items:[
{xtype:'datefield',fieldLabel:'field32',anchor:'100%'}
]
}
]
}
}
]
}
}
/*end*/
]

});

Ext.ux.bctf.WorkSpace.superclass.initComponent.call(this,arguments);
}

});

Ext.reg('workspancepanel', Ext.ux.bctf.WorkSpace);


i want to post the tab(pack-detail) and tab(pack-detail2) all field to server,but i can't do that,because i didn't have a form(try add form layout in that code,but it's didn't work),so please help me!!!

mitchellsimoens
20 Oct 2009, 7:11 AM
Wow, that's some ugly code. I don't think you get the idea of how to lay out you application.

What it looks like is you want a tabPanel which has 2 tabs: one for a "home page" and one for a form. And within the form, you want another tabPanel each having certain parts of a form to kind of organize it. This is easy but I think you need to learn how to code it.

So first create a "main" tabPanel with your 2 items (tabs). And on the second tab your gonna create your formPanel. In your formPanel is where you can create the second tabPanel.

It seems like you can get the tabPanel working but you didn't know you can get a tabPanel into a formPanel. So to get a tabPanel inside a formPanel, I want you to look at the example here (http://www.extjs.com/deploy/dev/examples/form/dynamic.html). Look at the last form and you can see how they did it.

Post back if you need more help.

httpdotcom
20 Oct 2009, 8:24 AM
Also remember that you need to look at why you need:

deferredRender: false
layoutOnTabChange: true
defaults: { hideMode: "offsets" }
for your second tabpanel, as the form will only submit as much as has been rendered, at the time of submission.

As mizzory pointed out, you need:

tab panel
items [
- object (home page)
- form panel
items [
- tab panel
items [
- panel, layout: form
- panel, layout: form
]
]
]

jeff.panh@gmail.com
21 Oct 2009, 5:41 AM
thank you!the issue is solve!!!:)