从SharePoint peoplepicker获取多个返回值以存储在列表

时间:2017-05-03 18:37:42

标签: javascript sharepoint-2013 peoplepicker

我不断收到“你只能输入一个名字”的消息。在使用以下代码创建的peoplepicker输入框(div)中:

// Render and initialize the client-side People Picker.
function initializePeoplePicker(peoplePickerElementId) {

    // Create a schema to store picker properties, and set the properties.
    var schema = {};
    schema['PrincipalAccountType'] = 'User,DL,SecGroup,SPGroup';
    schema['SearchPrincipalSource'] = 15;
    schema['ResolvePrincipalSource'] = 15;
    schema['AllowMultipleValues'] = true;
    schema['MaximumEntitySuggestions'] = 50;
    schema['Width'] = '280px';

    // Render and initialize the picker. 
    // Pass the ID of the DOM element that contains the picker, an array of initial
    // PickerEntity objects to set the picker value, and a schema that defines
    // picker properties.
    this.SPClientPeoplePicker_InitStandaloneControlWrapper(peoplePickerElementId, null, schema);
}

即使它有“schema ['AllowMultipleValues'] = true;”声明,在div中我必须将用户输入peoplepicker放入,我仍然只获得一个名称允许的消息。为什么呢?

它允许我输入多个名称并从弹出的下拉列表中选择名称,但是当我去收集名称时,似乎不让我从输入框中收集所有名称。

1 个答案:

答案 0 :(得分:0)

我有一个错字:

架构[' AllowMulitpleValues'] = true;

架构[' AllowMultipleValues'] = true;

我无法从我的来源复制我现有的代码。我不得不直接打字,并没有发现差异,直到同事抓住它。 ' il'到了' li'需要转换。