0
複数の入力が必要な人物ピッカー列のリストがあります。コンテンツエディタのWebパーツを使用して作成されたフォームがあります。クライアント側の人々に複数の値が通常クライアントサイドのピッカーに複数の値を設定する方法
複数の入力が必要な人物ピッカー列のリストがあります。コンテンツエディタのWebパーツを使用して作成されたフォームがあります。クライアント側の人々に複数の値が通常クライアントサイドのピッカーに複数の値を設定する方法
をjsom使用ピッカあなたは、クライアントの人々がHTMLでコントロール定義:
<div id="control" title="Users" spclientpeoplepicker="true"></div>
次に、あなたがそれを初期化する必要があります。あなたはこれらのJavaScriptファイルがロードされていることを保証する必要があり、それを正しく初期化するために
:autofill.js
、clienttemplates.js
、clientforms.js
、clientpeoplepicker.js
JavaScriptが制御値コードを設定します。
エンティティは、機能AddUserKeys
var userField = $("input[id$='ClientPeoplePicker_EditorInput']").get(0); // simplified user control search, real word scenario, first search proper row in your form
var peoplepicker = SPClientPeoplePicker.PickerObjectFromSubElement(userField);
peoplepicker.AddUserKeys("Login1"); // or display name
peoplepicker.AddUserKeys("Login2");
ジャワスクリプトのinit制御コード:
SP.SOD.loadMultiple(['autofill.js', 'clienttemplates.js', 'clientforms.js', 'clientpeoplepicker.js'], registerControls);
function registerControls() {
initPeoplePicker('control');
}
function initPeoplePicker (id, user) {
// 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'] = '311px';
// use code below to init controls with selected user
/*
var users = new Array(1);
var defaultUser = {};
defaultUser.AutoFillDisplayText = user.Value;
defaultUser.AutoFillKey = user.get_loginName();
defaultUser.Description = user.get_email();
defaultUser.DisplayText = user.get_title();
defaultUser.EntityType = "User";
defaultUser.IsResolved = true;
defaultUser.Key = user.get_loginName();
defaultUser.Resolved = true;
users[0] = defaultUser;
*/
// 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.
SPClientPeoplePicker_InitStandaloneControlWrapper(id, null/*users*/, schema);
}
私は人々からユーザーを取得する必要はありません。私はそれが動作thanks..hope私は私の答え –
から人々ピッカーに値を設定したいピッカー – tinamou
を更新したリスト –