Ajax is used for get data to client side. It’s special helpful in case get data at runtime.
The structure:
Ext.Ajax.request({
url: '/controller/GetData',
params: {
id: 1
},
timeout: 30000,
method: GET or POST,
async: isAsync // Synchronous or Asynchronous
success: function(response){
var text = response.responseText;
var result = Ext.JSON.decode(text);
// do something here .....
},
failure : function(response){
// do something when wrong ....
},
})