jean_marie
29 May 2009, 6:25 AM
Hi,
i'm exploring Ext.Direct and stumble when calling the API actions in JavaScript. I'm using this PHP stack http://extjs.com/forum/showthread.php?t=68186.
On server side i have coma_api.php which runs this code after all the default stuff:
$api = new ExtDirect_API();
$api->setRouterUrl('coma_router.php'); // default
$api->setNamespace('Ext.app');
$api->setDescriptor('Ext.app.REMOTING_API');
$api->add(
array(
'COMA_API_ViewHandler'
)
);
...
Within my test index.php i have this at the end of the file:
<script type="text/javascript" src="coma_api.php"></script>
<script type="text/javascript">
window.onload = function(){
Ext.Direct.addProvider(Ext.app.REMOTING_API);
COMA_API_ViewHandler.getUI(function(provider, response){
alert('tell todd');
});
};
</script>
When i open index.php Firebug tells me:
Ext.ns('Ext.app');
Ext.app.REMOTING_API = {"url":"coma_router.php","type":"remoting","actions":{"COMA_API_ViewHandler":[{"name":"getUI","len":0,"serverMethod":"getUI"}]},"namespace":"Ext.app"};
But calling COMA_API_ViewHandler gives me an JS error:
Fehler: COMA_API_ViewHandler is not defined
Quelldatei: https://myserver/index.php
Zeile: 46What i'm doing wrong? Do i miss anything?
Thanks in advance and best regards,
Jean Marie
i'm exploring Ext.Direct and stumble when calling the API actions in JavaScript. I'm using this PHP stack http://extjs.com/forum/showthread.php?t=68186.
On server side i have coma_api.php which runs this code after all the default stuff:
$api = new ExtDirect_API();
$api->setRouterUrl('coma_router.php'); // default
$api->setNamespace('Ext.app');
$api->setDescriptor('Ext.app.REMOTING_API');
$api->add(
array(
'COMA_API_ViewHandler'
)
);
...
Within my test index.php i have this at the end of the file:
<script type="text/javascript" src="coma_api.php"></script>
<script type="text/javascript">
window.onload = function(){
Ext.Direct.addProvider(Ext.app.REMOTING_API);
COMA_API_ViewHandler.getUI(function(provider, response){
alert('tell todd');
});
};
</script>
When i open index.php Firebug tells me:
Ext.ns('Ext.app');
Ext.app.REMOTING_API = {"url":"coma_router.php","type":"remoting","actions":{"COMA_API_ViewHandler":[{"name":"getUI","len":0,"serverMethod":"getUI"}]},"namespace":"Ext.app"};
But calling COMA_API_ViewHandler gives me an JS error:
Fehler: COMA_API_ViewHandler is not defined
Quelldatei: https://myserver/index.php
Zeile: 46What i'm doing wrong? Do i miss anything?
Thanks in advance and best regards,
Jean Marie