列表完成渲染后发生事件?
我正在使用 Spark 列表来呈现从 Web 服务获取的数据。 是否有一个事件在列表完成渲染所有数据后触发? 我想向用户显示加载图像,直到列表完成。
谢谢
I'm using a spark list to render data which I get from a web service.
is there an event which fires after the list has finished rendering all the data ?
I want to show a loading image to the user until the list finishes.
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我相信您正在寻找的事件是 updateComplete。
I believe the event you are looking for is updateComplete.
如果我是你,我会创建两种状态:“正在加载”和“正常”。默认设置currentState,初始状态为“正在加载”,期间显示加载程序。之后,我将检查您肯定在某处拥有的
data
属性。您可以绑定它来检查它是否不为空并相应地更改状态。这是一个示例:我省略了 data 属性,因为我确信您可以自己找出该部分。
If I were you, I'd create 2 states: "loading" and "normal". The initial state is "loading" by setting currentState by default, during which it shows a loader. After that, I would have a check on the
data
property that you surely have somewhere. You can bind that to check if it's not null and change the state accordingly. Here's an example:I left out the data property since I'm sure you can figure that part out on your own.