PDA

View Full Version : Ext.data.Store.load does not clear modified records


tbarstow
07-20-2007, 11:22 AM
The API docs for Ext.data.Store.getModifiedRecords says "Get all records modified since the last load, or since the last commit." This isn't the case though - when you load a data store, its modified records do NOT get cleared. This is true in Ext 1.0.1a and the 1.1RC1.

I am currently using a subclass to get around this, with the following:


load: function() {
wbd.ext.data.Store.superclass.load.apply(this, arguments);
this.modified = [];
}

jack.slocum
07-20-2007, 11:27 AM
This is a documentation error, not a bug in the code. Please report it in the doc error thread. Thanks!

mystix
07-20-2007, 02:18 PM
reported this in the doc bug thread on behalf of @tbarstow. :)

tbarstow
07-20-2007, 03:32 PM
ok that's true in this case - but Jack I'm sure you agree that it doesn't make sense for modified records to be persisted across data loads? it's such a tiny change to roll into the next release, and quite appropriate/useful imho.

thanks mystix.

jack.slocum
07-20-2007, 11:47 PM
Implicitly clearing out the modified records would break people editing data over paging and/or people who have bulk save operation - e.g. only when the user presses a Save button.

It's fairly simple to clear out the modified records if this is not desirable in your scenario.