Results 1 to 2 of 2

Thread: Need help to catch response after an call

  1. #1
    Sencha User
    Join Date
    Jun 2011

    Default Need help to catch response after an call

    Hey everyone.

    I've created a little mvc application with extjs. I setup 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 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: ''
        ,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


    In fact it was an error on my PHP function.
    It seems that's 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..

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts