PDA

View Full Version : How to handle exception in AjaxProxy.



profunctional
26 Jul 2011, 8:01 AM
I am listening for the exception in the proxy, but can't figure out if this is correct. There is no way to stop the loading gif to unload. I'm using code like this. Does anyone have sample code on how to handle errors with ajaxproxy? T




proxy: {
type: 'ajax',
actionMethods: 'POST',
url : listAction,
listeners: {
exception: function(proxy, response, operation){
setLoading(false);
console.dir( response.responseText )
Ext.Msg.alert('Oops!', "List could not be loaded.", Ext.emptyFn);
}
}
}

profunctional
28 Jul 2011, 6:44 PM
For real? Nobody knows how to handle the exception with AjaxProxy?

mattsawyer77
26 Sep 2011, 1:21 PM
I'd like to know this as well. Seems like this would be a very common need...

profunctional
26 Sep 2011, 2:32 PM
Add this to your store:

,
afterRequest: function(request, success) {
mainPanel.setLoading(false);
}