There are two ways to use proxies in extjs 4.1 (server proxies in my case), one can tie it to a model or tie it on a store.
I am a bit confused about the usage: What is the difference between tieing a proxy to a store, and tieing it to a model?
What situations would one use one way or the other?
OK I found it in the documentation of sencha App Architecture Part 2
Use proxies for models:
It is generally good practice to do this as it allows you to load and save instances of this model without needing a store. Also, when multiple stores use this same model, you don’t have to redefine your proxy on each one of them.
Use proxies for stores:
In Ext JS 4, multiple stores can use the same data model, even if the stores will load their data from different sources. In our example, the Station model will be used by the SearchResults and the Stations store, both loading the data from a different location. One returns search results, the other returns the user’s favorite stations. To achieve this, one of our stores will need to override the proxy defined on the model.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With