PDA

View Full Version : action.result is undefined in form.submit



adeeshak
31 Jan 2010, 9:05 PM
I,m new to ExtJs ..when i debug it shows only "undefined"
Here is my code :
var simple_form = new Ext.FormPanel({
frame: true,
title: 'New Request',
url: 'add_data.aspx',
method: 'POST',
lableWidth: 75,
bodyStyle: 'padding:5px 5px 0',
width: 350,
defaults: { width: 230 },
defaultType: 'textfield',

items: [{
fieldLabel: 'Caption',
name: 'cation'
}, {
fieldLabel: '',
name: 'CMRID',
hidden: true,
allowBlank: false
},
new Ext.form.DateField({
fieldLabel: 'Start Date',
name: 'Date'
}),
new Ext.form.DateField({
fieldLabel: 'Exp.Completion date',
name: 'Expected_date'
}),
{
xtype: 'textarea',
fieldLabel: 'Discription',
name: 'Discription',
flex: 1
}, {
fieldLabel: 'Request User',
name: 'request_user'
}
],
buttons: [{
text: 'Add',
type: 'submit',
handler: function() {
simple_form.getForm().submit({
url: 'add_data.aspx',
success: function(form, action) {
console.log(action.result);
store.reload();
var view = grid.getView();
view.refresh();
Ext.Msg.alert('Submitted Values', action.result.msg);

},
failure: function(form, action) {
console.log(action.result);
Ext.Msg.alert('FAILED', action.result.msg);

}
});
}
}, {
text: 'Clear',
handler: function() {
simple_form.getForm().reset();

}
}]

Regards,
Adeeshak8-|