Reputation: 1362
Why i can't use JSONP Store with this url http://www.sozler.im/rest/categories
When i am trying on Sencha Architect, right click on Store/Load Data it gives an error, but it works on browser
Here is the source
Ext.define('SozlerimMobile.store.CategoryStore', {
extend: 'Ext.data.Store',
requires: [
'SozlerimMobile.model.Categories',
'Ext.data.proxy.JsonP',
'Ext.data.reader.Json'
],
config: {
autoLoad: true,
autoSync: true,
model: 'SozlerimMobile.model.Categories',
storeId: 'CategoryStore',
proxy: {
type: 'jsonp',
extraParams: {
Status: 'Active'
},
url: 'http://www.sozler.im/rest/categories/',
reader: {
type: 'json',
clientIdProperty: 'id',
idProperty: 'id',
rootProperty: ''
}
}
}
});
Upvotes: 0
Views: 116
Reputation: 168
The webservice has to return JSONP (JSON with function callback - see http://json-p.org/)
The more info can be found in: https://stackoverflow.com/a/2067584/282834
Upvotes: 1