I have implemented Ext.Direct to return data to a Store however the directFn methods are not available within the javascript.
api.php returns
var Ext = Ext || {}; Ext.REMOTING_API = {"url":"php/api/router.php","type":"remoting","actions":{"RaStatuses":[{"name":"get_ra_statuses","len":1}]}};
router.php returns
{"type":"rpc","tid":1,"action":"RaStatuses","method":"get_ra_statuses","result":[{"ra_no":"2"},{"ra_no":"4"},{"ra_no":"6"},{"ra_no":"8"},{"ra_no":"10"}]}
...and successfully populates this store
Ext.define('CSM.store.ra.Statuses', {
extend: 'Ext.data.Store',
model: 'CSM.model.ra.Status',
proxy: {
type: 'direct',
directFn: "RaStatuses.get_ra_statuses"
},
autoLoad: true
});
However when I use this line from within a javascript function
a = RaStatuses.get_ra_statuses();
...I get
'ReferenceError: RaStatuses is not defined'
Have I misunderstood? Should Ext.Direct make this object available inside the js or was this wishful thinking?