PDA

View Full Version : [OPEN] Updating a record in a store with a sorter fires add and remove events



tobiu
25 Aug 2015, 9:31 AM
hi team,

the same one as my bug report for ext 5, not sure if this is tagged in your Jira for this version as well.

https://www.sencha.com/forum/showthread.php?293232

https://fiddle.sencha.com/#fiddle/bmf (switch to ext 6).

I double checked the code for 6.0.1.177.

It would be nice to drop in the following override, since this bug really is a showstopper.



Ext.define('Ext.overrides.data.Store', {
override : 'Ext.data.Store',

afterEdit : function (record, modifiedFieldNames) {
var me = this,
ignoreCollectionAdd = me.ignoreCollectionAdd,
ignoreCollectionRemove = me.ignoreCollectionRemove;

me.ignoreCollectionAdd = me.ignoreCollectionRemove = true;

me.needsSync = me.needsSync || record.dirty;
me.afterChange(record, modifiedFieldNames, Ext.data.Model.EDIT);

me.ignoreCollectionAdd = ignoreCollectionAdd;
me.ignoreCollectionRemove = ignoreCollectionRemove;
}
});


thx and best regards
tobi

Gary Schlosberg
26 Aug 2015, 6:32 AM
Thanks for the report. Looks like we're tracking that issue here:
https://www.sencha.com/forum/showthread.php?293232

rkleinkromhof
10 Mar 2016, 7:40 AM
This seems to be fixed in 6.0.1.250.

Your fiddle example no longer logs the add and remove events when using Ext JS 6.0.1.250 (tested with classic Neptune, classic Triton and modern Triton).

Gary Schlosberg
10 Mar 2016, 1:48 PM
Thanks for the update. I've confirmed it and noted it on the bug ticket, which will stay open until the issue can be fixed in 5.x.