Sencha Touch 商店“同步后”类似事件
我正在将 ListView
与 store/ajax-proxy/json-reader/json-writer 一起使用。我想在调用 store.sync()
之前将 ListView
设置为加载,并在从服务器返回响应后删除加载。
问题是,我不知道请求完成后可以在哪里挂接要处理的调用,因为我所做的只是调用 sync()
。
Store
有一个 beforesync
事件,我想要的是类似 aftersync
的事件。有什么想法如何实现这一点吗?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
通过阅读Sencha Touch源代码,发现
afterRequest
函数是在请求完成后立即调用的。此配置选项可以传递给任何 Ext.data.Proxy 子类。传递的两个参数是request
和success
。有趣的是,API 文档中没有它。
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 anyExt.data.Proxy
subclass. The two arguments passed arerequest
andsuccess
.Interesting though that it's not present in the API docs.