[FIXED] [2.3] Trunk r5130: PagingStore destroyStore Function Nulls Out data Causing clearData To Error Out

  1. #1

    [FIXED] [2.3] Trunk r5130: PagingStore destroyStore Function Nulls Out data Causing clearData To Error Out

    PagingStore:
        destroyStore : function () {        
            this.data = this.allData = this.snapshot = null;
            this.callParent(arguments); //<-- data is null before calling
        },
        clearData : function (isLoad) {
            var me = this,
                records,
                i;
    
            if (me.allData) {
                me.data = me.allData;
                delete me.allData;
            }
            else if (me.snapshot) {
                me.data = me.snapshot;
                delete me.snapshot;
            }
    
            if (!me.buffered) {
                records = me.data.items; // <-- TypeError: me.data is null
                i = records.length;
    
                while (i--) {
                    records[i].unjoin(me);
                }
            }
    
            this.data.clear();
    
            if (isLoad !== true || me.clearRemovedOnLoad) {
                me.removed.length = 0;
            }
        },
    AbstractStore:
        destroyStore: function() {
            var me = this;
    
            if (!me.isDestroyed) {
                me.clearListeners();
                if (me.storeId) {
                    Ext.data.StoreManager.unregister(me);
                }
                me.clearData(); // <-- this calls clearData with data being null
                me.data = me.tree = me.sorters = me.filters = me.groupers = null;
                if (me.reader) {
                    me.reader.destroyReader();
                }
                me.proxy = me.reader = me.writer = null;
                me.isDestroyed = true;
    
                if (me.implicitModel) {
                    Ext.destroy(me.model);
                } else {
                    me.model = null;
                }
            }
        },
    Last edited by Daniil; May 15, 2013 at 3:51 AM. Reason: [FIXED] [2.3]
  2. #2
    Hello!

    I was able to reproduce. We are investigating!

    Thank you!
  3. #3
    Maybe just reverse the two statements, call parent then set null?

    I am using this workaround right now, calling super to bypass Ext.NET destroyStore:
    Ext.data.PagingStore.override({
        destroyStore: function () {
            this.callSuper(arguments);
            this.data = this.allData = this.snapshot = null;
        }
    });
  4. #4
    It has been fixed in SVN using your suggestion. Thank you!

Similar Threads

  1. [CLOSED] [Trunk SVN] Summary Grid error
    By Aurelio in forum 2.x Legacy Premium Help
    Replies: 6
    Last Post: Jan 17, 2013, 10:48 AM
  2. [CLOSED] SVN 4741 Trunk Open Window Client Side Error
    By Aurelio in forum 2.x Legacy Premium Help
    Replies: 2
    Last Post: Jan 16, 2013, 11:21 PM
  3. Replies: 2
    Last Post: May 08, 2012, 3:34 PM
  4. Replies: 5
    Last Post: Jun 30, 2010, 3:13 PM
  5. [CLOSED] [1.0] Panel tools causing JS error
    By state in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Oct 19, 2009, 2:42 PM

Posting Permissions