-
1 Oct 2010 8:11 AM #1
delay ajax request
delay ajax request
I want to delay my ajax requst, for testing, how can i do that...........like wait 15 sec and then send request
-
1 Oct 2010 8:16 AM #2
To delay the request call, you can use Function.defer().
E.g.
Code:Ext.Ajax.request.defer(/*milliseconds*/, /*scope*/, [/*arguments*/]);
-
1 Oct 2010 8:23 AM #3
I m totally new so please dont mind.
so where i will put the delay as i was thinking more like thisHTML Code:myCall = Ext.Ajax.request({ //will this work Ext.Ajax.defer(1000); });
HTML Code:myCall = Ext.Ajax.request({ //will this work addListener: { delay: 1000 } , });
-
1 Oct 2010 8:38 AM #4
Do you want to delay the call or the return of the function?
-
1 Oct 2010 8:49 AM #5
return of the function - thats what i want to try first
-
1 Oct 2010 11:52 AM #6
You can do it this way:
Code:Ext.onReady(function() { var onFailure = function() { console.log('request failed'); console.log(arguments); }; Ext.Ajax.request({ url: 'wrongUrl.php', failure: function() { //Wait 5sec before doing anything onFailure.defer(5000, this, arguments); } }); });
Similar Threads
-
add a param to all Ext.Ajax.request (tree, store, normal Ajax.request)
By aj3423 in forum Ext 3.x: Help & DiscussionReplies: 2Last Post: 26 Jan 2010, 9:18 AM -
Delay AJAX processing in textfield
By amc709 in forum Ext 2.x: Help & DiscussionReplies: 0Last Post: 13 Aug 2009, 6:57 AM -
autoLoad vs Ext.Ajax.request... loadScripts not working w/Ajax.request
By zhegwood in forum Ext 3.x: Help & DiscussionReplies: 1Last Post: 6 Aug 2009, 3:28 PM -
Delay Ajax request before moving on..
By rballman in forum Ext 2.x: Help & DiscussionReplies: 7Last Post: 12 Feb 2008, 12:15 PM


Reply With Quote