PDA

View Full Version : How to remove dirty flag when editing value in grid



hudi1
30 May 2013, 12:37 AM
Hi,

I have grid of contacts. When I edit value in record and press save button then this new value is mark as dirty. How should I remove this flag ? I dont want to edit css but do something with store to remove this flag:

Action when I save contact:


onAcceptModifyContactClick : function(button, e, eOpts) {
console.log("onAcceptModifyContactClick");
var dialog = Ext.getCmp("ContactModify");
var form = dialog.down("form");
var values = form.getValues();

form.submit({
scope : this,
success : function(form, action) {
if (form.isValid()) {
console.log("modify, valid");
console.log(values);
var contact = form.getRecord();
contact.set(values);

contact.save({
scope : this,
callback : function(record, operation, success) {
console.log(record);
dialog.close();
}
});
}
},
failure : function(form, action) {
console.log("modify, invalid");
console.log(values);
}

});
},

existdissolve
30 May 2013, 4:56 AM
In your response to save(), are you returning the new data? That should automatically update the dirty state of the record.

Alternatively, if you don't want the "dirty" mark to show up at all, you can always configure the grid's view like so:


viewConfig: {
markDirty (http://docs-devel.sencha.com/extjs/4.2.1/#!/api/Ext.view.Table-cfg-markDirty): false
}

This will prevent the dirty marks from appearing ever.

klodoma1
29 Sep 2015, 5:22 AM
One should mark this as "answered".