matthewyarlett / AngularJS-Directive-for-SharePoint-People-Picker

An AngularJS directive that wraps up the Microsoft Client-side people picker
http://matthewyarlett.blogspot.com/2015/04/using-microsoft-client-side-people.html
9 stars 12 forks source link

Users display as unresolved #6

Closed halshing closed 6 years ago

halshing commented 6 years ago

Hi @matthewyarlett I am trying to load the people picker with values from a list when the form is loaded. I have the values getting populated in the people picker but they are unresolved. If I hit Ctrl+K to manually resolve the control the users resolved fine.

HTML:

<div ng-disabled="false" ui-people ng-model="configForm.ConfigA" pp-is-multiuser="{{true}}" pp-width="280px" pp-account-type="User,DL,SecGroup,SPGroup" id="pplSystem_ConfigA"></div>

JavaScript:

$scope.configForm = {};
myFactory.getSystemConfig("ConfigA").then(function (values) {
     $scope.configForm.ConfigA = { results: values }; // values is an array [{ Id: 2, Name: "My Group 1", Title: "My Group 1" }]
});
halshing commented 6 years ago

Disregard. I saw your comments regarding SPClientPeoplePicker.SPClientPeoplePickerDict[pickerId].ResolveAllUsers(); I uncommented those lines and everything resolved as expected :)