I would like to know if there is a way to generate a SharePoint 2010 People picker control just with JavaScript. Imagine that I am doing a Windows 8 App, I would like to create that control dynamically. Remember JavaScript only!
Thanks
|
I would like to know if there is a way to generate a SharePoint 2010 People picker control just with JavaScript. Imagine that I am doing a Windows 8 App, I would like to create that control dynamically. Remember JavaScript only! Thanks |
|||
|
|
|
I have a client side jQuery/SPServices/jQueryUI plugin that can do this for custom UI's. Take a look here: http://paultavares.wordpress.com/2012/04/28/sharepoint-ui-widgets-upload-and-pickusers/ I use it today in a custom UI I created for some projects. Paul. |
|||
|
|
OK, finally got. After long hours looking at the ugliest HTML/JS even written and short short periods of insanity, I add an idea that I don't totally like and it isn't the best, but at this point I don't f***ing care. I just want to get over this. So, I simple create a basic .aspx page with the follwing code:
I moved this page to _layouts folder on my SharePoint farm and name it PeoplePicker.aspx. Then on my page/app I just added a pointing to that aspx. That's it. I know it's ugly as hell and is clearly not the best solution, but at least it solves my problem. If some day my brain becomes strong enough to handle the craziness behind the peoplePicker generated code, I will share the proper solution. Thanks for your help eirikb |
|||
|
|
You can inject the correct markup directly into the DOM, I have tested this myself and it works perfectly. The People Picker does not depend on any document ready or similar. All you have to do is follow the correct markup and include the file entityeditor.js which you will find in the layouts folder. Another option is to use the Client Object Model to mimic the behavior, and use |
|||||||||||||||||||
|