PDA

View Full Version : [FIXED] Where do proxies go in MVC structure?



robl
14 Oct 2011, 5:20 AM
Where do proxies go in the MVC structure? Do they get automatically loaded like controllers, views, models, stores, etc... ?

BTW - From looking at the Kiva example, it appears that custom proxies are manually configured but I really don't understand it. Specifically, I don't understand why the proxy definition/class is in lib/KivaProxy.js. I would think it would be in something like proxy/Kiva.js and that the model would reference it. Can someone please explain?

TommyMaintz
14 Oct 2011, 6:59 AM
Proxies are defined directly on the Model or the Store 99% of the time. This is why we don't have a proxy folder. Kiva is an exception as it had to create a customized proxy. It might be worth looking into if it turns out many people are creating custom proxies.

Can I ask you what you need a custom proxy for in your app? Do you need a custom proxy, or where you just wondering where you had to define your proxies? If its the latter, then the answer is in your model or store definition.

robl
14 Oct 2011, 7:05 AM
I'm using PhoneGap and want to load contacts from the address book into a store.


Proxies are defined directly on the Model or the Store 99% of the time. This is why we don't have a proxy folder. Kiva is an exception as it had to create a customized proxy. It might be worth looking into if it turns out many people are creating custom proxies.

Can I ask you what you need a custom proxy for in your app? Do you need a custom proxy, or where you just wondering where you had to define your proxies? If its the latter, then the answer is in your model or store definition.

TommyMaintz
14 Oct 2011, 7:19 AM
I see, yes in that case you would want to create a custom proxy :D I will discuss this with the team, and see if it's something we can add in one of the upcoming releases. I'm moving this into the bug forum and opening a ticket for it.

robl
14 Oct 2011, 7:20 AM
Thanks!


I see, yes in that case you would want to create a custom proxy :D I will discuss this with the team, and see if it's something we can add in one of the upcoming releases. I'm moving this into the bug forum and opening a ticket for it.

robl
17 Oct 2011, 11:58 AM
I'm assuming that wiring up custom proxies in a MVC app in ST 2.x doesn't work but that custom proxies should. Right?

I tried creating a custom proxy following the Kiva example to access the contacts via PhoneGap. My class inherits from Ext.data.proxy.Proxy. The app fails to load now.

1. Is it possible to create a custom proxy with ST 2.x PR1 ?
2. Am I inheriting from the correct super class?

I'm using this ST 1.x example:

http://www.sencha.com/learn/a-sencha-touch-mvc-application-with-phonegap/