Home › Forums › vLooup for SharePoint › vLookup inline Editing People-Picker
Tagged: inline, people picker, vlookup
- This topic has 1 reply, 2 voices, and was last updated 5 years ago by Alexander Bautz.
-
AuthorPosts
-
-
October 31, 2019 at 03:25 #27521
Hi Alexander,
This is a follow up from the comment here:
https://spjsblog.com/2019/08/31/vlookup-inline-editing-examples/#comment-318334I have been trying to get this working for days, I just can’t get the value of the People Picker when I click the green tick.
The following is the code I am using and you can see the result in the animated GIF attached.
PLease note:
I have used the Field type single line of text example as a template.
I added var ppid to handle multiple People Picker elements in the vLookup.// Field type people-Picker function edit_inline_pp(val, id, listGuid, fin) { var ppid = "pp" + id ; var dVal = val, b = []; if (dVal === "") { dVal = "Click to add name"; } b.push("<div style='white-space:nowrap;' >"); b.push("<div class='vLookupDispWrap' onclick='toggleEditField(this);' >"); b.push("<span class='vLookupCurrVal' > " + dVal + " </span>"); b.push("</div>"); b.push("<div class='vLookupEditWrap' >"); b.push("<div id='" + ppid + "' onkeydown='event.stopPropagation()' style='height:22px' >"); //display people picker function showPP() { var schema = {}; schema.PrincipalAccountType = 'User,DL,SecGroup,SPGroup'; schema.SearchPrincipalSource = 15; schema.ResolvePrincipalSource = 15; schema.AllowMultipleValues = false; schema.MaximumEntitySuggestions = 50; schema.Width = '200px'; schema.Height = '50px'; this.SPClientPeoplePicker_InitStandaloneControlWrapper( ppid , null, schema); } setTimeout(function(){ showPP(); },250); //get People Picker value function getPPvalue(){ var ppid = "pp" + id ; var pp = SPClientPeoplePicker.SPClientPeoplePickerDict.ppid_TopSpan, users = pp.GetAllUserInfo(), arr; // Get current PP values arr = []; jQuery.each(users,function(i,o){ arr.push(o.Key); }); //not sure if this is correct? val = (JSON.stringify(arr)); b.push("<input type='text' value='" + val + "'>"); } b.push("</div>"); b.push("<span title='Save' style='cursor:pointer;margin:3px;color:green;font-weight:bold;' onclick='saveChangesInput(this,\"" + fin + "\",\"" + id + "\",\"" + listGuid + "\")'>✔</span>"); b.push("</div>"); b.push("</div>"); return b.join(""); }
Any questions just ask,
Thanks.- This topic was modified 5 years ago by Alexander Bautz. Reason: Fixed code snippet
Attachments:
-
November 3, 2019 at 20:56 #27560
I have made some changes to your code example and posted it here: https://spjsblog.com/2019/08/31/vlookup-inline-editing-examples/#People_picker_field
Alexander
-
-
AuthorPosts
- You must be logged in to reply to this topic.