I've exactly the same problem from this Question. However I'm using Sencha Touch 2 and I don't know how to actually use this custom store. I define my REST proxies inside the model classes. How would I access/use this custom proxy?
proxy: {
type: 'rest',
url: 'http://someUrl',
reader: {
type: 'json',
}
}
It is fairly simple in Sencha Touch 2. This presumes you have an MVC architecture.
Firstly, you model - app/model/Image.js:
Ext.define('MyApp.model.Image', {
extend: 'Ext.data.Model',
// Require your custom proxy
requires: ['MyApp.proxy.MyCustomProxy'],
config: {
fields: ['name'],
proxy: {
// set the type of your proxy
type: 'mycustomproxy'
}
}
});
And then define your proxy - app/proxy/MyCustomProxy.js:
Ext.define('MyApp.proxy.MyCustomProxy', {
extend: 'Ext.data.proxy.Proxy',
// Set your proxy alias
alias: 'proxy.mycustomproxy',
...
});
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