I'm attempting to both display a list from data in an external MySQL database and to insert records to the same database from a Sencha Touch App. After much confusion I was able to read and display the records using:
Ext.define("App.store.Share", {
extend: "Ext.data.Store",
required: "App.model.Share",
config: {
model: "App.model.Share",
proxy: {
type: 'jsonp',
api: {
create: "http://127.0.0.1/submit.php?action=create",
read: "http://127.0.0.1/submit.php?action=read",
update: "http://127.0.0.1/submit.php?action=update",
destroy: "http://127.0.0.1/submit.php?action=delete",
},
reader: {
type: 'json',
root: "ideas",
totalProperty: "total"
},
writer: {
type: 'json',
writeAllFields: true
}
},
pageSize: 3,
autoLoad: true,
autoSync: true
}
});
However, when I try to add a record to the database I get the error:
Uncaught Error: [ERROR][Ext.data.proxy.Server#create] JsonP proxies can only be used to read data.
I was originally using an ajax proxy but I can't use that either because of the whole cross-domain shenanigans. So if I can't use JsonP to write, and I can't use ajax, what can I do?
Thanks for any help!