PDA

View Full Version : ExtJs 3.4 - Problem Display a Ext.form.FormPanel in a Ext.Window



chris86
1 Jul 2014, 6:08 AM
Hey Community

I have a problem to display a FormPanel in a Ext .Window.
The window is displayed but the content of the window is empty.

The window is called from a button in a GridPanel.

Window:


var newcasedlg = new Ext.Window({
title: 'Open'
,layout: 'fit'
,width: 880
,height: 540
,minWidth: 400
,minHeight: 425
,closeAction:'hide'
,plain: true
,modal: true
,buttonAlign:'center'
,bodyStyle:'padding:5px;'
,items: newcaseform
});


FormPanel:



var newcaseform = new Ext.form.FormPanel({
baseCls: 'x-plain'
,labelWidth: 90
,autoHeight: true
,url:'xxx'
,border: false
,method: 'post'
,fileUpload: true
,monitorValid: true
,buttonAlign: 'left'
,layout: 'form'
,style: {
backgroundColor: 'white'
}
,items: [
{
xtype: 'fieldset'
,layout: 'anchor'
,headerCfg: {tag: 'div', cls: 'section-header', html: 'Test'}

,items: [..


Button:



var newCaseBtn = new Ext.Button({
id: 'btnNewCase'
,text: 'openButen'
,handler: function() {
newcaseform.getForm().reset();
newcaseform.findById('NewCaseForm_Beschreibung').setValue('xxx.');
newcasedlg.show();
caseNameStore.load();
}
});


Thanks for your help.

mitchellsimoens
3 Jul 2014, 4:44 AM
Have you inspected the DOM to see where the issue is and what node isn't sized correctly so you can know what component is having an issue?

chris86
4 Jul 2014, 1:30 AM
I solved the problem



var newcasedlg = new Ext.Window({
title: 'Open'
,layout: 'fit'
,width: 880
,height: 540
,minWidth: 400
,minHeight: 425
,closeAction:'hide'
,plain: true
,modal: true
,buttonAlign:'center'
,bodyStyle:'padding:5px;'
,items: new Ext.form.FormPanel({
baseCls: 'x-plain'
,id: 'newCaseForm'
,labelWidth: 90
,autoHeight: true
,url:'xxx'
,border: false
,method: 'post'
,fileUpload: true
,monitorValid: true
,buttonAlign: 'left'
,layout: 'form'
,style: {
backgroundColor: 'white'
}
,items: [
{

...
...