1. #1
    Sencha User
    Join Date
    Jan 2012
    Posts
    7
    Vote Rating
    -3
    pierluigi can only hope to improve

      0  

    Default Unanswered: How set a variable after ajax call?

    Unanswered: How set a variable after ajax call?


    How I can set "price" variable after ajax call? here the code:

    var price;
    var idProd = data.prodotto_id;

    var cb = function (o,s,r){

    price = Ext.util.JSON.decode(r.responseText).price;
    console.log(price);
    };
    Ext.Ajax.request({
    url : "index.php",
    params : {
    m : "Prodotti",
    a : 'prod-price-byquantity',
    idProd : idProd,
    quantity: qta
    },
    callback : cb,
    scope : this
    });


    console.log(price);
    In the last console.log(price) I see price as undefined

  2. #2
    Sencha User PhiLho's Avatar
    Join Date
    Nov 2011
    Location
    Near Paris, France
    Posts
    139
    Answers
    2
    Vote Rating
    1
    PhiLho is on a distinguished road

      0  

    Default


    I don't think it is an Ext GWT 3 question. If no moderator moves this topic, you should ask it in a proper section.

Thread Participants: 1