PDA

View Full Version : window hide / show with nested formpanel



noimehl
29 Nov 2010, 5:55 AM
Hi,

i have a window with a nested formpanel. when i hide and reopen the window the nested formpanel will not shown.

Can anyone help me?

here is my code for the window:


var win = new Ext.Window({
id: 'edittask'+ task
,width: 560
,height: 230
,plain: true
,title:'Title ' + task
,layout:'fit'
,loadMask: true
,waitMsg: 'loading...'
,border: false
,closeAction: 'hide'
,closable: true
,items: EditTaskFormPanel
});

win.show();

regards
thorsten

mankz
29 Nov 2010, 5:58 AM
Please post the rest of your code involved in this UI flow...

Condor
29 Nov 2010, 5:59 AM
1. How do you reopen the window?
2. Are you only hiding the window with the [x] button or did you also program other ways?

noimehl
29 Nov 2010, 6:40 AM
Hi,

1. win.show(); (is this wrong?)
2. yes, i use the [x] button or win.hide();


here is the code for the formpanel


var fp = new Ext.form.FormPanel({
id:'edittaskformpanel'
//,bodyStyle:'padding:15px'
//,labelWidth:70
,url: 'json-singletask.php'
,loadMask: true
,waitMsg: 'loading...'
,border:false
,frame:true
,items:[{
xtype:'textarea'
,fieldLabel:'Taskname'
,name:'taskname'
,anchor:'95%'
,allowBlank: false
,msgTarget: 'side'
},{
xtype:'numberfield'
,width:10
,fieldLabel:'Soll h'
,name:'sollh'
,anchor:'50%'
,allowBlank: false
,allowNegative: false
,msgTarget: 'side'
},{
xtype:'datefield'
,width:20
,fieldLabel:'Beginn'
,name:'start'
,anchor:'50%'
,disabledDays: [0,6]
,msgTarget: 'side'
,format: 'd.m.Y'
},{
xtype:'datefield'
,width:20
,fieldLabel:'Ende'
,name:'ende'
,anchor:'50%'
,disabledDays: [0,6]
,msgTarget: 'side'
,format: 'd.m.Y'
},{
xtype: 'hidden'
,name: 'tasknr'
},{
xtype: 'hidden'
,name: 'xaction'
,value: 'save'
},{
xtype: 'hidden'
,name: 'projekt'
},{
xtype: 'hidden'
,name: 'global'
}
]
,buttons:[{
text:'speichern',
handler: function() {
fp.getForm().submit({
waitMsg: 'saving...',
success: function(form, action) {
jbudgetstore.load({params: {xaction: 'read', projekt: params[0] }})

},
failure: function(form, action) {
Ext.Msg.alert('Warning','Error ');
}
})
}
},{
text:'abbrechen',
handler: function() {
fp.getForm().reset();

win.hide();
}
}]
});

noimehl
29 Nov 2010, 6:44 AM
HI,

1. win.show();
2. yes, i use the [x] button or win.hide(); i also tried win.remove(); but it was the same result

here is the cod e of the formpanel:


var EditTaskFormPanel = new Ext.form.FormPanel({
id:'edittaskformpanel'
,url: 'json-singletask.php'
,loadMask: true
,waitMsg: 'loading...'
,border:false
,frame:true
,items:[{
xtype:'textarea'
,fieldLabel:'Taskname'
,name:'taskname'
,anchor:'95%'
,allowBlank: false
,msgTarget: 'side'
},{
xtype:'numberfield'
,width:10
,fieldLabel:'Soll h'
,name:'sollh'
,anchor:'50%'
,allowBlank: false
,allowNegative: false
,msgTarget: 'side'
},{
xtype:'datefield'
,width:20
,fieldLabel:'Beginn'
,name:'start'
,anchor:'50%'
,disabledDays: [0,6]
,msgTarget: 'side'
,format: 'd.m.Y'
},{
xtype:'datefield'
,width:20
,fieldLabel:'Ende'
,name:'ende'
,anchor:'50%'
,disabledDays: [0,6]
,msgTarget: 'side'
,format: 'd.m.Y'
},{
xtype: 'hidden'
,name: 'tasknr'
},{
xtype: 'hidden'
,name: 'xaction'
,value: 'save'
},{
xtype: 'hidden'
,name: 'projekt'
},{
xtype: 'hidden'
,name: 'global'
}
]
,buttons:[{
text:'speichern',
handler: function() {
EditTaskFormPanel.getForm().submit({
waitMsg: 'saving...',
success: function(form, action) {
jbudgetstore.load({params: {xaction: 'read', projekt: params[0] }})
},
failure: function(form, action) {
Ext.Msg.alert('Warning','Error ');
}
})
}
},{
text:'abbrechen',
handler: function() {
EditTaskFormPanel.getForm().reset();

win.hide();
}
}]
});

thanks
thorsten