人物选取器JavaScript [英] People Picker JavaScript

查看:85
本文介绍了人物选取器JavaScript的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的问题与回发有关.如果我使用SharePoint内置的标准人员选择器,则无法在同一表格上进行javascript更新.因此,我希望能够像添加新产品时一样使用人员选择器来获取用户信息 存在的用户.换句话说,单击人员选择器图标,然后弹出人员选择器.然后,可以输入部分或全部用户名,以使用状态填充该字段.我该怎么做呢?


Richard Przybylski

My Issue is related to PostBack. If I use the standard people picker built into SharePoint I cannot have the javascript updates I am making on the same form. So I want to be able to get user information using the people picker as we do when we add new users with a presence. In other words click on the people picker icon and get the popup for people picker. Then be able to enter part of or all of the user name to populate the field with presence. How do I do this?


Richard Przybylski

推荐答案

您好,Richard,

Hi Richard,

检查以下代码是否对您有帮助:

Check if the below code helps you:

function getPickerInputElement(fieldName)
{
    var tags = document.getElementsByTagName('DIV');
    for (var i = 0; i < tags.length; i++) {
        var tempString = tags[i].id;
        if ((tempString.indexOf(identifier) > 0) && (tempString.indexOf('UserField_upLevelDiv') > 0))
        {
            var innerSpans = tags[i].getElementsByTagName("SPAN");
            for (var j = 0; j < innerSpans.length; j++) {
                if (innerSpans[j].id == 'content')
                {
                    return innerSpans[j].innerHTML;
                }
            }
        }
    }
    return null;
}


这篇关于人物选取器JavaScript的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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