问题
I'm using a ListView with a store/ajax-proxy/json-reader/json-writer. I'd like to set the ListView to loading before I call store.sync(), and remove the loading once the response got back from the server.
Problem is, I don't know where I could hook in my call to be processed once the request is done, as all I'm doing is calling sync().
Store has a beforesync event, what I'd like is something like aftersync. Any ideas how to accomplish that?
回答1:
By reading the Sencha Touch source code, it turns out that the afterRequest function is called just after the request is finished. This config option can be passed to any Ext.data.Proxy subclass. The two arguments passed are request and success.
Interesting though that it's not present in the API docs.
来源:https://stackoverflow.com/questions/7672571/sencha-touch-store-aftersync-like-event