function setLoginName() {
debugger;
var loginName = _spPageContextInfo.userLoginName;
var peoplePickerDiv = $("[id$='ClientPeoplePicker'][title='Name']");
var peoplePickerEditor = peoplePickerDiv.find("[title='Name']");
var spPeoplePicker = SPClientPeoplePicker.SPClientPeoplePickerDict[peoplePickerDiv[0].id];
peoplePickerEditor.val(loginName);
spPeoplePicker.AddUnresolvedUserFromEditor(true);
}
$(document).ready(function(){
SP.SOD.executeFunc('clientpeoplepicker.js', 'SPClientPeoplePicker', function () {
setLoginName(); //your code goes here
});
});
debugger;
var loginName = _spPageContextInfo.userLoginName;
var peoplePickerDiv = $("[id$='ClientPeoplePicker'][title='Name']");
var peoplePickerEditor = peoplePickerDiv.find("[title='Name']");
var spPeoplePicker = SPClientPeoplePicker.SPClientPeoplePickerDict[peoplePickerDiv[0].id];
peoplePickerEditor.val(loginName);
spPeoplePicker.AddUnresolvedUserFromEditor(true);
}
$(document).ready(function(){
SP.SOD.executeFunc('clientpeoplepicker.js', 'SPClientPeoplePicker', function () {
setLoginName(); //your code goes here
});
});
No comments:
Post a Comment