pbartels
29 Sep 2009, 11:48 PM
Hi all,
I'm not able to use the success return when submitting a form, this event is not triggered :((
I am using Ext Direct to post a form having:
api: {submit: Controller.SaveData}
in the config.
However I also defined a handler for a submit button which submits the form using form.submit().
In the submit config I defined a success function. As mentioned before this success function is not triggered.
Complete code:
var formActionButtons = [];
if(!isNew){
formActionButtons.push({
text: 'Delete',
handler: function(){
form.getForm().submit({params:{extTable:tableName,delete:"1"}});
}
})
}
formActionButtons.push({
text: 'Submit',
handler: function(){
form.getForm().submit({
params:{extTable:tableName},
success:function(a,b){
alert('q');
}
});
}
})
var form = new Ext.form.FormPanel({
buttons:formActionButtons,
title: tableName,
id : 'mainform',
border: false,
api: {submit: Controller.SaveData},
padding: 10,
paramOrder: ['uid'],
defaultType: 'textfield',
defaults: {anchor: '100%'},
items: this.GetItems(tableName)
});
return form;
Ciao!
I'm not able to use the success return when submitting a form, this event is not triggered :((
I am using Ext Direct to post a form having:
api: {submit: Controller.SaveData}
in the config.
However I also defined a handler for a submit button which submits the form using form.submit().
In the submit config I defined a success function. As mentioned before this success function is not triggered.
Complete code:
var formActionButtons = [];
if(!isNew){
formActionButtons.push({
text: 'Delete',
handler: function(){
form.getForm().submit({params:{extTable:tableName,delete:"1"}});
}
})
}
formActionButtons.push({
text: 'Submit',
handler: function(){
form.getForm().submit({
params:{extTable:tableName},
success:function(a,b){
alert('q');
}
});
}
})
var form = new Ext.form.FormPanel({
buttons:formActionButtons,
title: tableName,
id : 'mainform',
border: false,
api: {submit: Controller.SaveData},
padding: 10,
paramOrder: ['uid'],
defaultType: 'textfield',
defaults: {anchor: '100%'},
items: this.GetItems(tableName)
});
return form;
Ciao!