PDA

View Full Version : How to submit data from Ext.FormPanel with tabs?



maxkliver
18 Nov 2012, 9:47 PM
There are several tabs on a FormPanel:40157

Code:



var podform = new Ext.FormPanel({
labelAlign: 'left',
id: 'tab_6',
frame:true,
title: '???????? ???????',
bodyStyle:'padding:5px 5px 0',
width: 600,
listeners: {
'activate' : function(podform,records,options) {
console.log("store:"+store_form);
this.loaded = true;
var record = store_form.getAt(0);
podform.getForm().loadRecord(record);
}
},
reader : new Ext.data.XmlReader({
record : 'zem',
// success: '@success'
}, [
]),
items: []
});
podform.add(tabs_pod);

Now i try submit data to server:


podform.addButton({
text: 'Submit',
//disabled:true,
handler: function(){
podform.getForm().submit({
url:url_servlet+'submit.jsp',
waitMsg:'Saving Data...',
success: function(form, action) {
Ext.Msg.show({
title:'Success'
,msg:'Form submitted successfully'
,modal:true
,icon:Ext.Msg.INFO
,buttons:Ext.Msg.OK
});
}
});
}
});

But firebug says that i subbmit data only with panels that I have seen. Its means if i not click on second tab i cant get data from it.
Its possible to fix it?

maxkliver
18 Nov 2012, 10:13 PM
i find solution http://stackoverflow.com/questions/13448264/how-to-submit-data-from-ext-formpanel-with-tabs

willigogs
19 Nov 2012, 12:24 AM
http://docs.sencha.com/ext-js/3-4/?mobile=/api/Ext.TabPanel#cfg-deferredRender

maxkliver
19 Nov 2012, 1:15 AM
When i use deferredRender:false, first tab shows normal but another tabs looks like this:

willigogs
19 Nov 2012, 2:22 AM
Try setting your hideMode config to 'offsets', and if this doesn't work, perhaps layoutOnTabChange: true

http://docs.sencha.com/ext-js/3-4/#!/api/Ext.TabPanel-cfg-hideMode
http://docs.sencha.com/ext-js/3-4/#!/api/Ext.TabPanel-cfg-layoutOnTabChange