人员选择器-将项目添加到上下文菜单(找不到用户) [英] People Picker - add item to context menu (user not found)

查看:68
本文介绍了人员选择器-将项目添加到上下文菜单(找不到用户)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好

我想知道,当无法验证用户时,是否可以在人员选择器的上下文菜单中添加其他列表项.

i was wondering if it is possible to add additional listitem to context menu in people picker, when user cannot be validated.

点击新项目应调用wcf服务.

Click on new item should call wcf service.

我在SharePoint 2013-OnPremises中开发此项目,因此我也可以编辑客户端和服务器代码.

I developing this project in SharePoint 2013 - OnPremises so i can edit client and server code as well.

推荐答案

您好,  ;

Hi, 

您要添加到人员选择器上下文菜单中的值是什么?

What's the value you want to add to the people picker context menu ?

此菜单中的值应该是人名或电子邮件地址,如果要添加其他值,我建议您不要将其直接添加到上下文菜单中.

The value in this menu should be a person name or emailadress, if you want to add some additional value, I would not suggest you add it to the context menu directly.

另一方面,如果要在无法验证用户时添加其他用户名,则可以使用JavaScript代码检查用户是否解决:

On the other hand, if you want to add some other user name when user can not be validated, you can use JavaScript code to check if the user resolved:

SPClientPeoplePicker.SPClientPeoplePickerDict.peoplePickerDiv_TopSpan.HasResolvedUsers()

然后将用户键值添加到上下文菜单:

Then add the user key value to the context menu:

var peoplePicker = this.SPClientPeoplePicker.SPClientPeoplePickerDict.peoplePickerDiv_TopSpan;
peoplePicker.AddUserKeys(loginIdOrEmailOrSearchText, false);

一些有用的资源:

客户端人 选择器

Client side people picker

与客户选择器"一起使用

谢谢

最好的问候


这篇关于人员选择器-将项目添加到上下文菜单(找不到用户)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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