PDA

View Full Version : form.loadRecord event and originalValue



PV-Patrick
7 Mar 2011, 4:45 PM
Is the loadRecord form event supposed to set the originalValue value? I am trying to check if a formField has changed from the value it was originally loaded with by using isDirty() but it always returned that it is dirty and the originalValue is undefined. Is this a bug or am I going about this the wrong way? According to the docs, the .load() form function sets the originalValue automatically.

jash
10 Jun 2011, 1:02 AM
I have the same issue here.

When I have a formPanel and load it with a ext.data.Model, the dirtychange event is fired.

I want to make a configured and hidden tbar visible when the user edits the loaded record. now the tbar is made visible when data is loaded....

this might be a bug, not sure but it is strange

Jash

bregard
14 Sep 2011, 7:36 AM
I think this is a bad bug. I have a similar problem in that the change event is fired for all fields when using loadRecord. Anyone have any answers?

dfa
14 Oct 2011, 6:05 AM
I'm not sure if it is the right place to fix, but this works for me:


src/form/Basic.js:
setValues: function(values) {
var me = this;

function setVal(fieldId, val) {
var field = me.findField(fieldId);
if (field) {
if (me.trackResetOnLoad) {
field.suspendCheckChange++;
field.setValue(val);
field.initValue();
field.suspendCheckChange--;
} else {
field.setValue(val);
}
}
}

...

}