PDA

View Full Version : formpanel with other formpanels inside, submit problem.



maneljn
30 Aug 2012, 12:58 AM
I have a formpanel with fields, tabpanels with other fields, etc... Inside one of these tabpanel there is anothon formpanel with some fields named like the ones in parent form.
When i try this



formulario.getValues()


It returns the values from both forms and the repeated field names returns like an array of values.

Is it possible to get the fields values of parent form without adding the child forms values ??¿

sword-it
30 Aug 2012, 2:31 AM
Hi maneljn,

As you said both(child, parent) form have the same field name, one solution is change your form layout something like this -


var form = Ext.create('Ext.panel.Panel', {
title: 'Simple Display',
autoHeight:true,
renderTo: Ext.getBody(),
items:[
{
xtype:'form',
itemId:'parentForm',
items:[{
xtype:"textfield",
fieldLabel:'Name',
name:"a"}]
},{
xtype:'form',
itemId:'childForm',
items:[{
xtype:"textfield",
fieldLabel:'Name',
name:"a"}]
}
}]
});




yourPanel.getComponent(itemId).getForm.getValues(); // itemId: 'parentForm or childForm'