Hybrid View
-
15 Nov 2012 6:36 AM #1
ABorting AJAX request
ABorting AJAX request
Hi there,
I'm using the following code to abort a ajax request but it doesn't seem to work. I do see that the load mask is gone but the results are still being rendered in to the grid
Code://abort the request Ext.Ajax.abort(searchStore.proxy.activeRequest); //hide any masks var gMask = Ext.getCmp('searchGrid').loadMask; if(gMask && gMask.hide){ gMask.hide(); } }
-
15 Nov 2012 6:59 AM #2
Have you tried debugging to check that searchStore.proxy.activeRequest is populated prior to the abort attempt?
Code:console.log(searchStore.proxy.activeRequest) Ext.Ajax.abort(searchStore.proxy.activeRequest);
-
15 Nov 2012 11:53 AM #3
yeah, I did. I did find the correct way to do it. It's
that will kill the request. I'm surprised that the code which I used to kill the request didn't work was taken from sencha documents.Code:store.proxy.destroy()
-
15 Nov 2012 1:13 PM #4
In the sencha documentation, "searchStore" is the variable name of their store.
So for example:
Then to kill an Ajax call fired by this store:Code:var exampleStore = new Ext.data.Store({ ...Store Config... });
Code:Ext.Ajax.abort(exampleStore.proxy.activeRequest);
-
15 Nov 2012 1:39 PM #5
Be aware that destroying the entire store proxy may also create undesired problems (any other Ajax requests after it's destroyed nay not be successful).
-
16 Nov 2012 7:19 AM #6


Reply With Quote