Closed mirror25 closed 10 years ago
If I reduce filter (say form 2 to 1 filter) the store's logic breaks. Here is a fix:
diff --git a/Ext.ux.data.PagingStore.js b/Ext.ux.data.PagingStore.js index c7d47ca..6a76f36 100644 --- a/Ext.ux.data.PagingStore.js +++ b/Ext.ux.data.PagingStore.js @@ -136,10 +136,13 @@ Ext.define('Ext.ux.data.PagingStore', { delete me.allData; delete me.snapshot; me.clearData(true); - } else if (allData) { - allData.addAll(records); - } else if (snapshot) { - snapshot.addAll(records); + } else { + if (allData) { + allData.addAll(records); + } + if (snapshot) { + snapshot.addAll(records); + } } me.data.addAll(records); @@ -474,12 +477,11 @@ Ext.define('Ext.ux.data.PagingStore', { * records when a filter is removed or changed */ if (me.filters.getCount()) { - me.snapshot = me.snapshot || me.allData.clone() || me.data.clone(); + me.snapshot = me.snapshot || (me.allData && me.allData.clone()) || me.data.clone(); if (me.allData) { - me.data = me.allData; delete me.allData; } - me.data = me.data.filter(me.filters.items); + me.data = me.snapshot.filter(me.filters.items); me.applyPaging(); if (doLocalSort) {
Thanks, looking into it as I have time.
Code is updated and working. Master is Ext JS 4.1 and then there are the 4.2 and 5.0 branches. Updated unit tests are passing on all of the branches.
If I reduce filter (say form 2 to 1 filter) the store's logic breaks. Here is a fix: