问题
I have a situation like this.
When I load a form and set values as 'form.setValues(MyObject)', I do not want the form to get dirty. In Order to do that I have set the config 'trackResetOnLoad:true'. My problem is I need to reset the form to its fresh state before I move to new form. form.reset() won't work as the trackResetOnLoad will set the 'originalValue' of each field. Any Idea to reset the page without looping through each field of the form and reset it which brings me huge overhead as too many controls in the form.?
Thanks,
Anish Karunakaran.
回答1:
You could try and load an empty record in the form when wanting to reset it
form.getForm().loadRecord(Ext.create('Application.data.ModelName'));
After doing this, form.isDirty()
remains false
来源:https://stackoverflow.com/questions/29007751/extjs-form-reset-not-working-as-trackresetonload-is-true