Sencha Touch store 'aftersync'-like event

喜夏-厌秋 提交于 2019-12-11 03:34:56

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!