Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/444.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 如何在JSOM中使用ClientPeoplePicker_Javascript_Sharepoint_Sharepoint 2013 - Fatal编程技术网

Javascript 如何在JSOM中使用ClientPeoplePicker

Javascript 如何在JSOM中使用ClientPeoplePicker,javascript,sharepoint,sharepoint-2013,Javascript,Sharepoint,Sharepoint 2013,我正在创建SharePoint托管的应用程序。我想利用控件,但我很难在我的App.js函数中读取用户输入的值 以下是Default.aspx代码的突出显示部分: <%@ Register TagPrefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bc

我正在创建SharePoint托管的应用程序。我想利用
控件,但我很难在我的
App.js
函数中读取用户输入的值

以下是
Default.aspx
代码的突出显示部分:

<%@ Register TagPrefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register TagPrefix="WebPartPages" Namespace="Microsoft.SharePoint.WebPartPages" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register TagPrefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
...
<asp:TableCell>
  <SharePoint:ClientPeoplePicker ID="PMPeoplePicker" runat="server" Required="true" PrincipalAccountType="User" AllowMultipleEntities="false" ValidationEnabled="true" />          
</asp:TableCell>
...

查看此MSDN如何:在SharePoint托管的应用程序中使用客户端人员选取器控件

和微软提供的演示代码


谢谢@Ken,这很有帮助。事实上,我自己也看到了这篇文章,它确实解决了我的问题,但是,由于
initializePeoplePicker
方法取代,我发现很难解决控件上的验证问题(必填字段,输入的用户文本已解决,仅一个用户,不允许分组),正如我在所提供的示例中从纯
开始一样。你处理过验证吗?谢谢
function getPM() {
  // This is obviously not working ...
  var pm = $("#PMPeoplePicker");
  return pm;
}