I have an http API which (shockingly new technique) reacts on different errors setting different response statuses.
The question is – while using Ext.data.Store with some XMLHttpRequest-inside proxy, what is the best way to handle this statuses? As far as I can understand, “load” event does not pass status directly, as well as “exception”, and the last one actually doesn’t even trigger when 4** status is received.
So, as I can see from code xhr instance is hidden from Ext.data.store, so the question is also can be stated as “What is best extjs practice to handle low-level xhr object”.
There is no exception event on Ext.data.Store. Instead, it is Ext.data.proxy.Server and its sub-classes (like Ext.data.proxy.Ajax) that define an exception event. Listeners receive a response object which includes the http status.
Depending on your setup, you can register a listener on the store’s proxy, or – if your store uses a model – on the model’s proxy.
This test setup worked for me on Chrome 14 and FF 6: