Thank you for reporting this bug. We will make it our priority to review this report.
  1. #1
    Ext JS Premium Member SebTardif's Avatar
    Join Date
    Feb 2011
    Location
    Cambridge, MA
    Posts
    666
    Vote Rating
    39
    SebTardif has a spectacular aura about SebTardif has a spectacular aura about

      0  

    Default [4.0.0] performance problem caused by store.removeAll() not clearing prefetchData

    [4.0.0] performance problem caused by store.removeAll() not clearing prefetchData


    In IE indexOf is very slow, and if we add lot of data to store before, then after store.removeAll(), the replace call done against existing data in prefetchData is making IE spin so popup a warning asking the user if want to kill the script.

  2. #2
    Sencha Premium Member
    Join Date
    Feb 2009
    Posts
    316
    Vote Rating
    3
    azuroff will become famous soon enough

      0  

    Default


    I'm also having a problem with this, but in a different context - we have a tree and an infinite-scrolling grid. The user clicks on a node in the tree, the related information is loaded into the grid using a store.guaranteeRange() call in the itemclick handler -

    Code:
    me.gridStore.removeAll();
    me.gridStore.guaranteeRange(0, Math.min(record.get('productCount'), me.gridStore.pageSize) - 1);
    This works fine the first time. The second time, the guaranteeRange() call doesn't load anything because the old data is still loaded in the store's prefetchData - despite the removeAll() call. For now I think I can work around it by manually calling me.gridStore.prefetchData.clear(), but I'd expect the removeAll() call to handle that.

  3. #3
    Sencha Premium Member
    Join Date
    Feb 2009
    Posts
    316
    Vote Rating
    3
    azuroff will become famous soon enough

      0  

    Default


    Here's an override that seems to clean things up a little better when using a buffered store:

    Code:
    Ext.override(Ext.data.Store, {
        removeAll: function(silent) {
            var me = this;
    
            me.clearData();
            if (me.snapshot) {
                me.snapshot.clear();
            }
            if (me.prefetchData) {
                me.prefetchData.clear();
            }
    
            delete me.guaranteedStart;
            delete me.guaranteedEnd;
            delete me.totalCount;
    
            if (silent !== true) {
                me.fireEvent('clear', me);
            }
        }
    });

Similar Threads

  1. Replies: 0
    Last Post: 16 May 2011, 12:34 PM
  2. Replies: 5
    Last Post: 17 Mar 2011, 11:25 PM
  3. store.remove(rec) doesn't refresh, but store.removeAll() does?
    By ekhanh101 in forum Ext 3.x: Help & Discussion
    Replies: 9
    Last Post: 23 Nov 2010, 5:34 AM
  4. grid.getStore().removeAll() not clearing all data in grid.
    By PuritysDisciple in forum Ext 2.x: Help & Discussion
    Replies: 2
    Last Post: 23 Feb 2008, 11:40 AM

Thread Participants: 1

Tags for this Thread