0

我不断收到“您只能输入一个名字”的消息。在我使用以下代码创建的 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);
}

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

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

4

1 回答 1

0

我有一个错字:

模式['AllowMulitpleValues'] = true;

不是:

架构['AllowMultipleValues'] = true;

我无法从我的源代码中复制我现有的代码。我必须直接输入它,并且没有发现差异,直到同事发现它。'il' 到 'li' 需要切换。

于 2017-05-09T14:32:14.443 回答