Skip to content

Instantly share code, notes, and snippets.

@wilk
Created September 23, 2014 13:29
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save wilk/8848ce037faf7429ca23 to your computer and use it in GitHub Desktop.
Save wilk/8848ce037faf7429ca23 to your computer and use it in GitHub Desktop.
Example with Ext.ux.Deferred
var dfd1 = Ext.create('Ext.ux.Deferred'),
dfd2 = Ext.create('Ext.ux.Deferred'),
dfd3 = Ext.create('Ext.ux.Deferred');
Ext.Ajax.request({
url: 'your/url',
success: function (data) {
dfd1.resolve(data);
},
failure: function (err) {
dfd1.reject(data);
}
});
Ext.Ajax.request({
url: 'your/url2',
success: function (data) {
dfd2.resolve(data);
},
failure: function (err) {
dfd2.reject(data);
}
});
Ext.Ajax.request({
url: 'your/url3',
success: function (data) {
dfd3.resolve(data);
},
failure: function (err) {
dfd3.reject(data);
}
});
Ext.ux.Deferred.when(dfd1, dfd2, dfd3).then(function (data1, data2, data3) {
console.log(data1, data2, data3);
}, function (err1, err2, err3) {
console.log(err1, err2, err3);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment