Im new to extjs, which could be right place to apply my proxy, is it store or model? What is the difference over them, which could be better place to gain more advantage?
-
1Have a look here: http://stackoverflow.com/questions/7742117/should-i-specify-the-proxy-in-the-model-or-the-store and here: http://stackoverflow.com/questions/7404870/extjs-how-to-use-proxy-model-how-are-they-related – PHP May 03 '13 at 11:08
1 Answers
Proxy can now be attached to either a Store or a Model. Proxies can be configured with Readers and Writers which decode and encode communications with your server.
What different in adding to model or store?
Store: We configured our Store to use an Ajax Proxy, telling it the url to load data from and the Reader used to decode the data. In this case our server is returning JSON, so we've set up a Json Reader to read the response. Here store support addition feature such as filter,sorting and grouping which we can do in mode class.
Model: Model is just a set of fields and their data. four principal parts of Model are Fields, Proxies, Associations and Validations. so its clear that apart from proxies it support associations and validations. Its main benefit is that we can easily load and save Model data without creating a Store.
As whole we can say its based on your requirement to decide which one to use. mostly everyone prefer store to avail many feature rather than model.

- 3,191
- 4
- 19
- 31