PDA

View Full Version : extJS4 Ext.Window no submit?



crashT
4 Nov 2011, 3:11 AM
Hello, what's wrong, I call with a button in another form, a new window. This is a form and a submit button. However, I can not perform submit, the url is not addressed? There is also no error message in Firebug. Succes is true.



var bannerform = new Ext.Window({
title: 'Banner',
id: 'bannerwindow',
height: 475,
width: 530,
layout: 'fit',
items: [
{
xtype: 'form',
height: 394,
method: 'GET',
autoScroll: true,
bodyPadding: 10,
preventHeader: true,
id: 'bannerform',
title: 'bannerform',
ref: 'bannerform',
items: [
{
xtype: 'textfield',
id: 'headline',
fieldLabel: 'Überschrift',
anchor: '100%'
},
{
xtype: 'htmleditor',
height: 150,
id: 'description',
style: 'background-color: white;',
fieldLabel: 'Beschreibung',
anchor: '100%'
},
{
xtype: 'filefield',
fieldLabel: 'Grafik',
buttonText: 'Hochladen ...',
anchor: '100%'
}
]
}
],
dockedItems: [
{
xtype: 'toolbar',
dock: 'bottom',
items: [
{
xtype: 'tbfill'
},
{
xtype: 'button',
text: 'Banner speichern',
margin: '2 10 5 10',
height: 35,
width: 130,
handler:function(){
var bannerform = Ext.getCmp('bannerform').getForm();
console.log('Window', bannerform);
console.log('Values', bannerform.getValues()); // its ok
bannerform.submit({
url: 'test.php',
success: function ( bannerform, action ) {
Ext.Msg.alert('Status', 'Banner wurde gespeichert.');
},
failure: function() {
Ext.Msg.alert('Status', 'Es ist ein Fehler aufgetreten!');
}
});
}
},
{
xtype: 'button',
text: 'Fenster schließen',
margin: '2 10 5 10',
height: 35,
width: 130,
handler:function(){
Ext.getCmp('bannerwindow').close();
}
}
]
}
]
});

Here is the call


...
{
xtype: 'button',
margin: '25 0 25 35',
padding: 10,
text: 'Banner hinzufügen',
handler: function(){
bannerform.show();
}
...

mitchellsimoens
16 Nov 2011, 12:15 PM
You are reusing the bannerform variable
You are using Ext.getCmp for other purposes than debugging
What debugging have you done?

crashT
16 Nov 2011, 10:35 PM
Thank you for your answer, the problem is now solved.