ExtJS AJAX
Introduction#
A singleton instance of an Ext.data.Connection
class. This class is used to communicate with your server side.
Basic Request
Some of the Class properties Ext.Data.Connection
Properties | Details |
---|---|
url |
Address of the request |
timeout |
Waiting time in milliseconds |
success |
Return on success |
failure |
Return on failure |
Ext.Ajax.on("beforerequest", function(conn , options , eOpts) {
console.log("beforerequest");
});
Ext.Ajax.on("requestcomplete", function(conn , response , options , eOpts) {
console.log("requestcomplete");
});
Ext.Ajax.on("requestexception", function(conn , response , options , eOpts) {
console.log("requestexception");
});
Ext.Ajax.request({
url: 'mypath/sample.json',
timeout: 60000,
success: function(response, opts) {
var obj = Ext.decode(response.responseText);
console.log(obj);
},
failure: function(response, opts) {
console.log('server-side failure with status code ' + response.status);
}
});