Dearest Forum,
I am seeking to perform a routine task of accessing a MySQL table and performing CRUD operations on it via Ext.Direct. All attempts have been frustrated thus far.
I employ the recommended MVC folder structure and app set up.
The app:
Code:
Ext.application({
name: 'DragonFly',
autoCreateViewport: true,
controllers: ['Ledger'],
models: ['Ledger'],
stores: ['Ledger'],
init: function() {
Ext.direct.Manager.addProvider(Ext.app.REMOTING_API);
},
});
The data/api.php script returns:
Code:
Ext.ns("Ext.app"); Ext.app.REMOTING_API = {"url":"router.php","type":"remoting","actions":{"QueryLedger":[{"name":"getResults","len":1},{"name":"createRecord","len":1},{"name":"updateRecords","len":1},{"name":"destroyRecord","len":1}]}};
To me, this indicates that it is working. Inside controller:
Code:
proxy: {
type: 'direct',
model: 'Ledger',
api: {
create: QueryLedger.createRecord,
read: QueryLedger.getResults,
update: QueryLedger.updateRecords,
destroy: QueryLedger.destroyRecord
},
},
The code breaks here on an error at "create". Ext.Direct documentation states that the Ext.app.REMOTING_API should be added to my global namespace, yet this indicates to me that it isn't. Any ideas why?
Also, I noticed that the return of api.php does not have '"url" : "routing\/router"' in it, as the examples indicate. It's missing the first part. Is this cause for alarm?
Appreciate it,