-
30 Jan 2012 2:31 AM #1
Answered: Proxy in Model vs. Store
Answered: Proxy in Model vs. Store
Does anyone know the difference between using a proxy in a model vs. using a proxy in a store?
Code:Ext.regModel('User', { fields: ['id', 'name'], hasMany: {model: 'Order', name: 'orders'}, proxy: { type: 'ajax', url : 'src/demos/data/userData.json' } });
-
Best Answer Posted by mitchellsimoens
Technically there really isn't a difference. The store will look for the proxy config on itself and if none is present look for it on the model. If you want to use Models by themselves (like for forms) then having the proxy on the model will allow you to still use the proxy.
-
30 Jan 2012 9:28 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,640
- Vote Rating
- 435
- Answers
- 3106
Technically there really isn't a difference. The store will look for the proxy config on itself and if none is present look for it on the model. If you want to use Models by themselves (like for forms) then having the proxy on the model will allow you to still use the proxy.
Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
https://github.com/mitchellsimoens
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services services@sencha.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!
When posting code, please use BBCode's CODE tags.
-
30 Jan 2012 2:12 PM #3
It would be nice if the documentation explained things like this

-
30 Apr 2012 1:52 AM #4


Reply With Quote