PDA

View Full Version : [CLOSED][3.1] store.removeAll() doesn't do all the bookkeeping required



mschwartz
1 Jan 2010, 10:15 AM
If you have a store with modified records and call store.removeAll(), store.getCount() does not return 0.

OK, I think it's not right what I just posted.

What's wrong is store.getModified() returns modified records after store.removeAll() is called.

Condor
2 Jan 2010, 12:12 AM
It only clears modified records if you configure your store with pruneModifiedRecords:true.

mschwartz
4 Jan 2010, 6:31 AM
It only clears modified records if you configure your store with pruneModifiedRecords:true.

I found that by examining the source.

The function should be renamed to store.removeMostlyAllButNotTheModifiedRecords() or something.
:D

Condor
4 Jan 2010, 6:37 AM
IMHO using pruneModifiedRecords:true as default would have been a better design decision.

I would recommend:

Ext.data.Store.prototype.pruneModifiedRecords = true;

mschwartz
4 Jan 2010, 6:40 AM
IMHO using pruneModifiedRecords:true would have been a better design decision.

I would recommend:

Ext.data.Store.prototype.pruneModifiedRecords = true;

true should be the default so the function does what is advertised.