简体   繁体   English

Enyojs为Ajax调用添加加载器效果,直到成功响应

[英]Enyojs add a loader effect for ajax call until successful response

I m new in enyojs. 我是enyojs的新手。 I have succesfully made an ajax call for listing data. 我已经成功地进行了ajax调用以列出数据。 What i need now is loader effect until data is loaded from ajax call. 我现在需要的是加载器效果,直到从ajax调用加载数据为止。 Any help is appreciated. 任何帮助表示赞赏。 Thanks in advance. 提前致谢。

You can easily do something like use a Popup with a Spinner in it. 您可以轻松地执行某些操作,例如在弹出窗口中使用微调框。 You can set a flag on your app/view when you begin the fetch: 开始提取时,您可以在应用/视图上设置标志:

this.app.set('fetchingData', true);

and set it to false in the callback. 并在回调中将其设置为false。 Then have the Popup show while fetching. 然后在提取时显示Popup。 you can set this up with a binding if you like: 您可以根据需要使用绑定进行设置:

bindings: [
    {from: 'app.fetchingData', to: '$.popup.showing'}
]

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM