1. #1
    Sencha User
    Join Date
    Jun 2011
    Vote Rating
    alxs17 is on a distinguished road


    Default Need help to catch response after an ext.direct call

    Need help to catch response after an ext.direct call

    Hey everyone.

    I've created a little mvc application with extjs. I setup ext.direct to comunicate with the server side ( PHP server).

    In my app menu, when I click on a button, I want to call a PHP method and receive the data (with the data I want to create a dynamic form but it's not really important now)

    Everything seem to work fine. I call the php method, and in my browser javascript console, I see the result.
    But how can I catch this result ???

    In my main application I've add an ext.direct provider like this :

         name: 'client_app'
        ,appFolder: 'client_app'        
        ,autoCreateViewport: false
        ,launch: function() {
    my api.php :

    PHP Code:

    // Include ExtDirect PHP Helpers

    $cache = new ExtDirect_CacheProvider('cache/api_cache.txt');
    $api = new ExtDirect_API();

    $api->setRouterUrl('server_app_php/router.php'); // default

    'autoInclude' => true,
    'basePath' => 'classes'



    $_SESSION['ext-direct-state'] = $api->getState();
    and finally in a controller of my app (Header.js) :

    Ext.define('client_app.controller.Header', {
         extend: 'Ext.app.Controller'
        ,views: [ 'Header']
        //à l'initialisation du controlleur
        ,init: function() {
             'header_menu button[action=dspManageMandate]' :{
              click: this.testevent}
        testevent: function() {
            // In this function I try to 
            var callback = function(response, e){
                        //This alert never show so we never get in this function. Don't understand
                        //why ??
                        alert('Call back ok = '+e.status);
            //There is my call which seem to work, because I see the JSON answer in my browser console 
            //var dynForm = Ext.create('client_app.view.Dynamic_form').show();
    If someone could explain my how catch my php method answer. Or explain me why my app never go into my "callback" function. Or give my an sample or anything.... I would really appreciate !!!

    I'm on it since 3days and I really don't know what to do....

    I check these web page but still don't understand my problem ;



  2. #2
    Sencha User
    Join Date
    Jun 2011
    Vote Rating
    alxs17 is on a distinguished road



    In fact it was an error on my PHP function.
    It seems that's ex.direct could send the response. But after was not able to generate the callback function.

    So event you see your methode answer on your firebug JS console, it could have an other error in your PHP side..

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi