How to destroy stores in ExtJS 4.1?

I used the store property autoDestroy. Clear memory resources. But I can no longer find this in the API.

I found the ones EXTJSIV-4844 - Ext.data.Store autoDestroy config is missinglisted in 4.1 RC1 Bug Fixes (although I cannot find a thread for this error anywhere).

Now in RC3 this config has left the API, and it is no longer in the source files.

I used Ext.destroyfor views, but never for stores. The way the API describes the method Ext.destroy here , it sounds like this: "This method is for widgets, but it accepts any object and sees what it can do." - In other words, not very final.

Does anyone know if it works Ext.destroyfor stores and removes them from memory? Or what is the recommended way to do this?

+5
source share
1 answer

Ext.data.Store.destroyStore , . - ( , show private ), , , 3.4. Store.destroy http://docs.sencha.com/ext-js/3-4/#!/api/Ext.data.Store-method-destroy. 4.x Store.destroy, . http://docs.sencha.com/ext-js/4-1/source/AbstractStore.html#Ext-data-AbstractStore:

// private
destroyStore: function() {
    var me = this;

    if (!me.isDestroyed) {
        if (me.storeId) {
            Ext.data.StoreManager.unregister(me);
        }
        me.clearData();
        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.clearListeners();
        me.isDestroyed = true;

        if (me.implicitModel) {
            Ext.destroy(me.model);
        } else {
            me.model = null;
        }
    }
},
+8

All Articles