I am looking for the Best practice in one use case, (using sencha touch 2 framework) :
I have multiple ajax calls (JSONP response), and I want to filter feed data by date between all of those response. The problem is I do not when to start filtering. I want to know when all ajax is completed.
in jQuery I would use, "promises", for ex:
$.when($.ajax("/page1.php"), $.ajax("/page2.php"), ... $.ajax("/pageN.php")).done(function(a1, a2){
// do something
});
, I cannot find any similar "Deferred" in sencha touch 2, or maybe you can suggest me another way to detect and data was loaded.
I appreciate any suggestion help or the best practice in this situation.
UPDATES:
Yes, I use everywhere the sencha touch "Ext.Ajax.request".
I tried to use something like this , to catch all requests:
Ext.Ajax.on('beforerequest', this.dosomething, this);
Ext.Ajax.on('requestcomplete', this.dosomething, this);
Ext.Ajax.on('requestexception', this.dosomething, this);
But nothing gets fired, in any of these 3 cases,
PS: I tried to execute this event on my main mage is "initialized" as well when i "lunch" the whole application, in any situation it doesn't fire anything.
Is this something wrong when and how I try to fire the event.
Thanks in advice !!!