Can I somehow stop the .load() process when the proxy associated with a store encounters an exception, such as 404?
I’m using the Ajax proxy. There is an ‘exception’ event on the proxy, but I could not figure out what exactly to do in the callback.
Right now, the store tries to stuff the data into the model (using the mappings defined by me), even though there is no data, which results in ugly red error messages.
UPDATE
Maybe it would be better not to stop the load() process, but instead to handle the missing data in the thing (reader?) that actually converts the JSON to model instances. The idea is to handle missing data gracefully. How would I do that?
That’s a little tricky, especially if your store is tied to a dataviewer component.
The
load()process will be halted once it reaches theexceptionevent so I believe you have no control there.You could manually populate data into the store using the
store.add()when handling the Ajax’sexceptionevent,My code is based on ExtJS 3 syntax and may vary with ExtJS 4’s but the concept should be the same.