Yes.. JavaScript SharePoint People Picker… try saying that 3 times fast.

Anyway, I needed one for a form I was developing. It had to be client side, and it needed to work with SharePoint.

In SharePoint 2013, there’s already support for this: http://msdn.microsoft.com/en-us/library/jj713593.aspx

But I need something for SharePoint 2010. I found several articles on manipulating the data in the people picker, but very little on creating a people picker. I continued to google, and my googling bore fruit:

Tanmay Shahane has a neat little bit of code that uses the EntityEditor.js to create a people picker – obviously you should be including jQuery into your page for Tanmay’s script to work. The complete post is here: http://community.zevenseas.com/Blogs/Tanmay/Lists/Posts/Post.aspx?ID=7

But if the link is broken or something, Tanmay’s code as follows:

function EntityEditorHandleCheckNameResult(result, ctx) {
    ULSGjk: ;
    EntityEditorClearWaitCursor(ctx);
    EntityEditorCallback(result, ctx);
    //login name
    var loginName = $(“span.ms-entity-resolved”).attr(“title”);
    //display name
    var displayName = $(“span.ms-entity-resolved div:first-child”).attr(“displaytext”);
//Your custom code can go here for populating rest of the fields in the form calling user profile through client object model
}

Paul Tavares has some interesting widgets for People picking and Uploading that look promising, but I have yet to try them out:

http://paultavares.wordpress.com/2012/04/28/sharepoint-ui-widgets-upload-and-pickusers/

Categories: JavaScriptSharePoint

Related Posts

SharePoint

A tragic tale of mutliple lists and forms and IE9

I’ve been busy on a project for SharePoint. This particular environment is unique in that the developers do not have access to the farm, and must put any requests through a processed managed by the Read more…

SharePoint

Using Rest For Everything

I’ve ceased using the “Out of the Box” forms. I don’t even use the WebParts unless I have to. To me the most useful part of SharePoint is the REST API. https://msdn.microsoft.com/en-us/library/office/jj164022.aspx#ReadingData I organize my Read more…

SharePoint

List Creation Naming Best Practice

When you create a new List or Document Library or “App” object in SharePoint, the name of Object is the new URL – in essence what we WordPress users would call the “slug” or permalink. This is a Read more…