View Full Version : Is it ok to reuse a Store instance but just change its proxy's url property?

12 Jan 2012, 11:30 AM
I am integrating with RESTful services that return links as the properties for nested items. For example, if I had an order object that was returned, the items for that order would be in a link:


And then I have to go query that URL for the items. I have grids that reference these types of stores, and depending on whether the user selects a particular value from either a ComboBox or a grid, I then change the URL of the store's proxy to match what the user selected and load the store.

Is this ok to do? What are best practices for Ext when one has to do this type of thing?

Thanks in advance,


12 Jan 2012, 12:13 PM
I often have updated the url. The only thing I would say no to is if you are going to use that store in more than one widget at a given time.

12 Jan 2012, 12:24 PM
I am using it across multiple widgets and seeing some _really_ odd behavior. How would you recommend handling this, seeing how the components require a store to render?

12 Jan 2012, 12:36 PM
If you need a different dataset or store independence across widgets, then each widget needs it's own store.

12 Jan 2012, 12:45 PM
By data set do you mean a completely different model or just instance of data? All the widgets bound to this store use the same model. Would it be a better idea for me to create multiple instances (with different storeId values) of the same store class and bind those to each widget?

12 Jan 2012, 12:54 PM
The way i approached this scenario was to create one URL for all my requests something like:

Then whatever back end you have the "route" method would just call whatever i need it to run.

12 Jan 2012, 1:01 PM
Thanks romerve, but unfortunately we are integrating with a third party REST API and cannot do this.

13 Jan 2012, 5:40 PM
Hi Mitchell,

Quick question: when setting the URL manually on the store's proxy, do I need to do anything to clear its internal state? Is there any way to flush all of its internal entries and return it to a pristine state?

Also, is there any way to force an Ext object, in particular a store, to be deleted/garbage collected?

Thanks again,