自定义显示模板和加载图标 [英] Custom display template and loading icon

查看:72
本文介绍了自定义显示模板和加载图标的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨!

我构建了自定义搜索项和控件模板.

I build my custom search item and control template.

我的问题是,如何显示加载图标,直到显示所有结果?

My question is, how can I render a loading icon until the all results are displayed?

当用户单击精炼机之一时,我想显示"waiting/loading"图标,直到结果出来.

When the user click one of refiners, then I would like show "waiting/loading" icon, until the results are coming.

请帮助!

谢谢

Niki

推荐答案

在控制模板中,在"div"中包含一个加载图像,您可以将该图像转换为Base64并直接包含在您的控制模板中.    

In your Control Template include a loading image in a 'div', you can convert the image to Base64 and include directly in your Control Template.    

然后在完全加载后使用下面的功能将其隐藏.

Then use below function to Hide it, once its fully loaded.

AddPostRenderCallback(ctx, function(){})

更多详细信息,请访问此处:https://blogs.technet.microsoft.com/sharepoint_quick_reads/2013/08/01/sharepoint-2013-customize-display-template-for-content-by-search- web-part-cswp-part-1/

more details you can get here : https://blogs.technet.microsoft.com/sharepoint_quick_reads/2013/08/01/sharepoint-2013-customize-display-template-for-content-by-search-web-part-cswp-part-1/


这篇关于自定义显示模板和加载图标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆