如何在显示模板[Control]内容搜索Web部件中获取返回结果的数量? [英] How to get number of return results in display template[Control] content search web part?

查看:52
本文介绍了如何在显示模板[Control]内容搜索Web部件中获取返回结果的数量?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我为内容搜索Web部件创建显示模板(控件/项目).

I create the display template (Control / Item) for Content Search Web Part.

我的问题是如何在控件显示模板中获取返回结果的数量,以便可以在显示模板的标题中显示数量.

My question is how to get the number of return results in the control display template so that I can show the number in the header of the display template.

最好的问候,


推荐答案

在内容搜索显示模板"中,您可以使用下面的行在每个页面中显示结果计数:

In Content Search Display Template, you could use below line to show the result count in each page :

ctx.ClientControl.get_numberOfItems();

更多信息:

Useful JavaScript to know when working with SharePoint Display Templates

用于构建自定义内容搜索显示模板的示例:

Sample to build a Custom Content Search Display Template:

使用以下方法进行简单分页内容搜索Web部件

谢谢

最好的问候


这篇关于如何在显示模板[Control]内容搜索Web部件中获取返回结果的数量?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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