Results 1 to 7 of 7

Thread: [FIXED] [2.x] Destroying a Store doesn't destroy its underlying proxy

  1. #1
    Sencha User mystix's Avatar
    Join Date
    Mar 2007
    Location
    Singapore
    Posts
    6,236
    Vote Rating
    5
      0  

    Default [FIXED] [2.x] Destroying a Store doesn't destroy its underlying proxy

    destroying a Store does not destroy its underlying DataProxy.

    the following code resolves this
    Code:
    Ext.override(Ext.data.store, {
        destroy : function() {
            if (this.storeId || this.id) {
                Ext.StoreMgr.unregister(this);
            }
    
            if (this.proxy) {
                Ext.destroy(this.proxy);
            }
    
            this.data = null;
            this.purgeListeners();
        }
    });

  2. #2
    Sencha - Community Support Team Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,246
    Vote Rating
    119
      0  

    Default

    Shouldn't a store also destroy its reader?

  3. #3
    Sencha User mystix's Avatar
    Join Date
    Mar 2007
    Location
    Singapore
    Posts
    6,236
    Vote Rating
    5
      0  

    Default

    yes it should. i was only concentrating on the Store though

    [edit]
    on 2nd thought, how would it do that?

  4. #4
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    18,583
    Vote Rating
    873
      0  

    Default

    Just FYI, the proxy and the reader don't have destroy methods, but they probably should, at the very least to purge the listeners.
    Evan Trimboli
    Twitter - @evantrimboli

  5. #5
    Sencha User mystix's Avatar
    Join Date
    Mar 2007
    Location
    Singapore
    Posts
    6,236
    Vote Rating
    5
      0  

    Default

    Quote Originally Posted by evant View Post
    Just FYI, the proxy and the reader don't have destroy methods, but they probably should, at the very least to purge the listeners.
    whoops... my bad... forgot to include my custom override (for the proxy):
    Code:
    Ext.override(Ext.data.DataProxy, {
        destroy: function() {
            this.purgeListeners();
        }
    });
    Ext.override(Ext.data.HttpProxy, {
        destroy: function() {
            // abort current request, if any
            if (this.activeRequest) {
                Ext.Ajax.abort(this.activeRequest);
            }
    
            Ext.data.HttpProxy.superclass.destroy.call(this);
        }
    });

  6. #6
    Sencha User mystix's Avatar
    Join Date
    Mar 2007
    Location
    Singapore
    Posts
    6,236
    Vote Rating
    5
      0  

    Default

    [friendly bump ]
    affects 3.x too -- not sure how this weighs in with the new Ext.Direct stuff though.

    p.s. @condor, re: Reader destruction, how would we do that?

  7. #7
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    18,583
    Vote Rating
    873
      0  

    Default

    Committed both branches.

    RE: direct, we need some good way of cancelling transactions, though I don't know there's a good way to handle that when we're considering request batching...

    I'll mark this one as fixed now.
    Evan Trimboli
    Twitter - @evantrimboli

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •