Forn
16 Apr 2012, 9:51 AM
Hello. I have the next work:
formPersonalData = Ext.getCmp('formPersonalData').getForm();
if (formPersonalData.isValid()){
formPersonalData.updateRecord(currentCustomer);
currentCustomer = formPersonalData.getRecord();
currentCustomer.save({
success: function(record){
Ext.Mesg.alert('Сообщение', 'Данные сохранены.');
},
failure: function(record){
Ext.MessageBox.show({
title: 'Ошибка',
msg: 'Ошибки при сохранении данных. Обратитесь к администратору.',
buttons: Ext.MessageBox.OK,
icon: Ext.MessageBox.ERROR
});
},
})
}
but when the update request send the data in the currentCustomer is that is was before changes in the form.
What I do wrong?
formPersonalData = Ext.getCmp('formPersonalData').getForm();
if (formPersonalData.isValid()){
formPersonalData.updateRecord(currentCustomer);
currentCustomer = formPersonalData.getRecord();
currentCustomer.save({
success: function(record){
Ext.Mesg.alert('Сообщение', 'Данные сохранены.');
},
failure: function(record){
Ext.MessageBox.show({
title: 'Ошибка',
msg: 'Ошибки при сохранении данных. Обратитесь к администратору.',
buttons: Ext.MessageBox.OK,
icon: Ext.MessageBox.ERROR
});
},
})
}
but when the update request send the data in the currentCustomer is that is was before changes in the form.
What I do wrong?