I'm having problems with form reset... i have a form that is used for add (no initial values) and for edit. The problem is that if edit a register first, when i open the add form, it has the values from the last edition... even if i call form.getForm().reset().
I also tried with trackResetOnLoad true or false... but the problem is always the same... can anybody help please! I'm using ExtJs 2.1.
Thanks for reply... here's the code... when doing reset, the form come up with the last values that were filled during edit action (basic setValues for all fields).
=====
var grid = new Ext.grid.GridPanel({
<several grid options here>
tbar:[{
text:'Add Payment',
tooltip:'Add a new payment',
iconCls:'add',
handler: function(){
form.getForm().reset();
formWindow.setTitle('Add Payment');
formWindow.show();
AddSubmitButton.show();
EditSubmitButton.hide();
f1DateField.setValue(new Date());
}
}]
});
grid.render();
var form = new Ext.form.FormPanel({
baseCls: 'x-plain',
labelWidth: 60,
monitorValid: true,
items: [f1DateField, f2MethodField, f3AmountField, f4RefField],
buttons: [AddSubmitButton, EditSubmitButton,
{
text: 'Cancel',
handler: function(){
FormWindow.hide();
}
}]
});