0

I used the article from MSDN:

Use the client-side People Picker control in SharePoint-hosted SharePoint Add-ins.

It's working perfect on a page in the site, not related to any app. Now I want to implement it in the "share invitation" dialog, to set the schema to the exiting people picker or to hide the existing people picker and add a new one instead.

But it's not working, I'm getting error:

Cannot read property 'SPClientPeoplePicker_InitStandaloneControlWrapper' of undefined.

2
  • I'm not sure I understand, are you trying to customise the built in share dialog, or are you creating your own custom share dialog as a part of an app? Commented Jan 12, 2016 at 14:46
  • Im trying to customise the OOB share dialog without any app just js file. Is it possible? on the other hand Im trying to add a new peoplepicker to the dialog but i have a problem to sync between both
    – Romi
    Commented Jan 13, 2016 at 13:12

1 Answer 1

1

Try to wrap your code like this:

SP.SOD.executeFunc('clientpeoplepicker.js', 'SPClientPeoplePicker', function () {
                //code goes here
            });

Looks like the sharepoint javascript file you need hasn't been loaded yet.

2
  • It's still not working...same error.I saw that I need more dependencies, but If I add the files the function is not executing at all...SP.SOD.executeFunc('clienttemplates.js', 'clientforms.js', 'clientpeoplepicker.js', 'autofill.js', 'sp.RequestExecutor.js', 'sp.js', 'sp.runtime.js', 'sp.core.js', 'SPClientPeoplePicker', function () { //my function }); by the example above with only 2 dependencies, the function is callled but im getting error. once I added more dependencies the function is not executed
    – Romi
    Commented Jan 13, 2016 at 6:36
  • 1
    Haven't had the requirement before to load multiple files, but I think SP.SOD.executeFunc is only suited when requesting one file. Please check this post if this helps: jasonscript.wordpress.com/2013/07/24/sharepoint-load-multiple
    – Oak3
    Commented Jan 13, 2016 at 6:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.