-
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
-
Sencha User
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.
Sencha is used by over two million developers. Join the community, wherever you’d like that community to be
or Join Us