PDA

View Full Version : onerror to terminate ajax request



johija
26 Jul 2013, 1:04 PM
I use the below onerror function for non-EXT errors. My Extjs page is still showing 'Loading' even after the flow goes to the onerror function and it returns false. Please let me know how to stop the request, and go the previous user entry text box from onerror.



<script type="text/javascript">
window.onerror = function(msg, url, linenumber) {
alert('Server error caught in window.onerror');
return false;
}
</script>

johija
26 Jul 2013, 2:57 PM
Or else, can I stop the Model from loading (showing loading message) when an error occurs?

slemmon
30 Jul 2013, 4:44 PM
See if abortAll is what you're after:
http://docs.sencha.com/extjs/4.2.1/#!/api/Ext.Ajax-method-abortAll



Ext.Ajax.abortAll();