-
18 Mar 2009 7:52 PM #1
[FIXED] [2.x] Destroying a Store doesn't destroy its underlying proxy
[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(); } });
Sencha Docs / Ext 3.x - ( Docs | Examples )
Learning Center / Saki's Examples (for 2.x) / HOWTO - ( Report Bugs | Post Proper Code )
-
18 Mar 2009 9:45 PM #2Sencha - Community Support Team
- Join Date
- Mar 2007
- Location
- The Netherlands
- Posts
- 24,251
- Vote Rating
- 40
Shouldn't a store also destroy its reader?
-
18 Mar 2009 10:08 PM #3
yes it should. i was only concentrating on the Store though

[edit]
on 2nd thought, how would it do that?
Sencha Docs / Ext 3.x - ( Docs | Examples )
Learning Center / Saki's Examples (for 2.x) / HOWTO - ( Report Bugs | Post Proper Code )
-
19 Mar 2009 12:35 AM #4
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
Sencha Developer
Twitter - @evantrimboli
Don't be afraid of the source code!
-
19 Mar 2009 12:50 AM #5
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); } });
Sencha Docs / Ext 3.x - ( Docs | Examples )
Learning Center / Saki's Examples (for 2.x) / HOWTO - ( Report Bugs | Post Proper Code )
-
13 May 2009 1:45 AM #6
[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?
Sencha Docs / Ext 3.x - ( Docs | Examples )
Learning Center / Saki's Examples (for 2.x) / HOWTO - ( Report Bugs | Post Proper Code )
-
14 May 2009 5:33 AM #7
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
Sencha Developer
Twitter - @evantrimboli
Don't be afraid of the source code!


Reply With Quote