首页 > 代码库 > [SharePoint 2013] Set value for people editor with JSOM
[SharePoint 2013] Set value for people editor with JSOM
function PeoplePicker() { this.context = null; this.web = null; this.currentUser = null; this.parentTagId = null this.SetParentTagId = function (id) { this.parentTagId = id; } this.SetLoggedInUser = function () { if (this.parentTagId != null) { this.getWebUserData(); } } this.getWebUserData = http://www.mamicode.com/function () {"input[title=‘" + $(parentTagId).attr(‘title‘) + "‘]"); _ppe.val(value); var _ppo = SPClientPeoplePicker.SPClientPeoplePickerDict[this.parentTagId]; _ppo.AddUnresolvedUserFromEditor(true); } }}function SetWebUserData() { var pplPicker = new PeoplePicker(); var controlId = $(‘td.ms-formlabel:contains("field name")‘).siblings(‘td‘).find(‘div[title="field name"]‘).prop("id"); pplPicker.SetParentTagId(controlId); pplPicker.SetLoggedInUser();}$(document).ready(function(){ ExecuteOrDelayUntilScriptLoaded(SetWebUserData, "sp.js");});
[SharePoint 2013] Set value for people editor with JSOM
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。