chio1
28 Jan 2011, 6:16 AM
Hi ,
I'm trying to change my function:
getData: function(id) {
var context = 'Text';
return context;
},
to use service to grab data:
getData: function(id ) {
var context;
var processRequest = function(response) {
context = response.responseText;
};
Ext.Ajax.request({
url: 'Data/Read',
success: processRequest,
params: { id : id }
});
return context;
},
i have problem, context variable is empty (Request is made and service returning correct data) , what should i do to wait for response from ajax call and then return context value ?
I'm trying to change my function:
getData: function(id) {
var context = 'Text';
return context;
},
to use service to grab data:
getData: function(id ) {
var context;
var processRequest = function(response) {
context = response.responseText;
};
Ext.Ajax.request({
url: 'Data/Read',
success: processRequest,
params: { id : id }
});
return context;
},
i have problem, context variable is empty (Request is made and service returning correct data) , what should i do to wait for response from ajax call and then return context value ?