Sencha Touch商店'aftersync'样的事件 [英] Sencha Touch store 'aftersync'-like event
问题描述
我正在使用一个 ListView
与一个商店/ ajax-proxy / json-reader / json-writer。在我调用 store.sync()
之前,我想设置 ListView
加载,并删除加载一次回复该服务器的响应。
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.
问题是,我不知道我可以在我的通话中挂起一个请求完成后被处理的一切,就像我所有的正在调用 sync()
。
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()
.
商店
有一个 beforesync
事件,我想要的是像$ code> aftersync 。任何想法如何实现?
Store
has a beforesync
event, what I'd like is something like aftersync
. Any ideas how to accomplish that?
推荐答案
通过阅读Sencha Touch源代码,结果是 afterRequest
函数在请求完成后调用。此配置选项可以传递给任何 Ext.data.Proxy
子类。通过的两个参数是请求
和成功
。
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
.
有趣的是,它不在 API文档中。
这篇关于Sencha Touch商店'aftersync'样的事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!