JS部分:

<script type="text/javascript">
function PeoplePicker() {
     var siteCollUrl = _spPageContextInfo.siteAbsoluteUrl;
var searchString = $("#txtPeoplePicker").val();
var sDialogUrl = siteCollUrl + '/_layouts/15/Picker.aspx'
+ '?MultiSelect=False'
+ '&CustomProperty=User,SecGroup,SPGroup;;15;;;False'
+ '&EntitySeparator=;'
+ '&DialogTitle=Select People and Groups'
+ '&DialogImage=' + siteCollUrl + '/_layouts/15/images/ppeople.gif'
+ '&PickerDialogType=Microsoft.SharePoint.WebControls.PeoplePickerDialog, Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c'
+ '&DefaultSearch=' + escapeProperly(searchString); var dialogWidth = 575;
var dialogHeight = 500;
var options = { title: "选择用户", width: dialogWidth, height: dialogHeight, resizeable: true, url: sDialogUrl, dialogReturnValueCallback: DelegatePeoplePickerCallback };
var rv = EnsureScriptParams("SP.UI.Dialog.js", "SP.UI.ModalDialog.showModalDialog", options);
} function DelegatePeoplePickerCallback(dialogResult, xmlResult) {
if (dialogResult > 0) {
var $xml = $(xmlResult);
var fqn = $xml.find('Entity').attr('DisplayText');
$("#txtPeoplePicker").val(fqn);
$("#txtPeoplePicker").focus();
} return;
}
</script>

页面代码:

<div class="input-group">
<input id="txtPeoplePicker" type="text" />
<span>
<a onclick="PeoplePicker(); return false;" href="javascript:" >
<img title="参照" alt="参照" src="/sites/xxx/_layouts/15/images/addressbook.gif">
</a>
</span>
</div>

在SharePoint 2013 Wiki Page中使用用户选择对话框的更多相关文章

  1. 如何在 在SharePoint 2013/2010 解决方案中添加 ashx (HttpHandler)

    本文讲述如何在 在SharePoint 2013/2010 解决方案中添加 ashx (HttpHandler). 一般处理程序(HttpHandler)是·NET众多web组件的一种,ashx是其扩 ...

  2. SharePoint 2013混合模式登陆中 使用 自定义登陆页

    接前一篇博客<SharePoint 2013自定义Providers在基于表单的身份验证(Forms-Based-Authentication)中的应用>,当实现混合模式登陆后,接着我们就 ...

  3. Adding a WebPart to a SharePoint 2013 Master Page 分类: Sharepoint 2015-07-08 01:03 7人阅读 评论(0) 收藏

    On SharePoint 2013 you can not add the Web Parts to the master page the same way of 2010. Please use ...

  4. SharePoint 2013在浏览器中打开pdf文档

    在没有安装Office Web Apps的情况下,SharePoint 2013是支持在IE上直接打开pdf和Excel文档的(只能查看,不能编辑,部分Excel会报错). 当然,需要现在管理中心做一 ...

  5. SharePoint 2013 网站定义中添加页面布局

    今天在Visual Studio 2012中将页面布局打包到网站定义中. 新建Module “MasterPageGallary” 在Element中如下: <Elements xmlns=&q ...

  6. 【解决】SharePoint 2013 当鼠标悬停在用户名称上时页面会崩溃

    参考下面文章,此问题是由于IE中的Office插件版本不正确所致,只需在 控制面板 > 程序和功能 中修复 Office 的安装即可. http://sympmarc.com/2013/11/2 ...

  7. SharePoint 2013 在母版页中插入WebPart

    最近QQ群里有朋友问,如何在母版页里插入自己开发的WebPart.其实很简单,母版页中虽然不允许插入WebPartZone,但是Designer就可以插入WebPart:或者手动注册,然后插入WebP ...

  8. webkit中获取用户选择文本和编程设定选择文本

    一.需求背景 在 Android 应用中,内嵌一个 WebView,希望捕获用户点击事件,通过 javascript 判断用户点击的是否英文单词,如果是则将被点击单词发给应用做进一步处理,并实用 ja ...

  9. VS中让用户选择路径

    //选择文件 OpenFileDialog ofd = new OpenFileDialog(); ofd.ShowDialog(); MessageBox.Show(ofd.FileName); / ...

随机推荐

  1. uva10635 LIS

    Prince and PrincessInput: Standard Input Output: Standard Output Time Limit: 3 Seconds In an n x n c ...

  2. HTML 字符实体 &lt; &gt: &amp;等

    在 HTML 中,某些字符是预留的. 在 HTML 中不能使用小于号(<)和大于号(>),这是因为浏览器会误认为它们是标签. 如果希望正确地显示预留字符,我们必须在 HTML 源代码中使用 ...

  3. gg

    纪念那段为了梦想的青春岁月,CS. Esp (2006-2014) name "Esp"bind "TAB" "+showscores"bi ...

  4. 收集移动端HTML5/H5使用的插件

    日期: http://t.cn/R2UOFoW 地区: http://www.jq22.com/jquery-info8371 头像: http://fex.baidu.com/webuploader ...

  5. 查看Mysql版本号 (最简单的是status )

    一.使用命令行模式进入mysql会看到最开始的提示符;二.命令行中使用status可以看到;三.使用系统函数等等,   查看版本信息 #1使用命令行模式进入mysql会看到最开始的提示符 Your M ...

  6. python的错误和异常

    python错误和异常 错误 错误分为语法错误和逻辑错误 语法错误 >>> if File "<stdin>", line 1 if ^ Syntax ...

  7. 搭建NFS服务器

    1:yum install -y nfs-utils-* portmap-* 2:NFS安装完毕,需要创建共享目录,共享目录在vi /etc/exports文件里面配置,可配置参数如下: /data/ ...

  8. thinkphp vendor

    vendor('weixin.request'); 对应文件:Core\Library\Vendor\weixin\request.php import('weixin.request#class') ...

  9. CSS的选择器

    <div id="demo"> <div class="inner"> <p><a href="#" ...

  10. weblogic安全漫谈

    今天,我来与大家探讨一下关于weblogic的话题 在进入内网后,如图: 当我们看到7001时,我们就可以测试weblogic反序列化漏洞,如图: 证明,漏洞存在,查看一下权限,如图: 理论上,我们可 ...