View Full Version : formpanel updateRecord - always sets model.dirty to true

1 Jul 2011, 1:16 AM
when calling updateRecord from Ext.form.FormPanel my model was always getting marked dirty, even if the data values had not changed. I've tried to make this smarter by applying a small change to the function so it now looks as below:

updateRecord: function(instance, enabled) {
var fields, values, name;
if(instance && (fields = instance.fields)){
values = this.getValues(enabled);
for (name in values) {
if(values.hasOwnProperty(name) && fields.containsKey(name)){
if(instance.data[name] != values[name]){
instance.set(name, values[name]);
return this;

this means that if I call updateRecord to read form fields into my model, it only marks the model as dirty if the values read in differ to what was already in the model. Any chance of incorporating this change?