如何将电话号码添加到“人们命名”结果 [英] How To Add Phone Number to "People Named" result
问题描述
Hello SharePoint Fam,
Hello SharePoint Fam,
我能够将Work Phone字段添加到实际人员结果显示中,但我不确定如何实际添加Work Phone默认"一切"本地SharePoint结果,其中显示"人员命名"。 显示名称,
职位名称&部门和我想要只添加工作电话字段。 有人可以告诉我需要调整什么才能使Work Phone出现吗?
I was able to get Work Phone field added to the actual people results display, but I am not sure how to actually get Work Phone added to default "Everything" Local SharePoint Results where it says "People Named". It shows Name, Position Title & Department and I am wanting to just add the Work Phone field as well. Could someone tell me what needs tweaked to make the Work Phone appear as well?
感谢N前进任何帮助
推荐答案
以下是供您参考的解决方法。
将AddPostRenderCallback添加到Item_Default.html。
window.runCheck = false;
AddPostRenderCallback(ctx, function () {
if (!window.runCheck) {
if (ctx.ListData.ResultTables && ctx.ListData.ResultTables.length>0) {
var firstData = ctx.ListData.ResultTables[0].ResultRows[0];
if (firstData.WorkPhone&&firstData.WorkPhone != "") {
var phoneDiv = document.createElement("div");
phoneDiv.className = 'phoneDiv';
var t = document.createTextNode("Phone:" + firstData.WorkPhone);
phoneDiv.appendChild(t);
document.getElementById("NameField").appendChild(phoneDiv);
//alert(firstData.WorkPhone);
window.runCheck = true; }
}
}
});
结果:
最好的问候,
Lee
这篇关于如何将电话号码添加到“人们命名”结果的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!