I need a share functionality in sharepoint page using my custom share button. The custom share button is present in each row of list item. List is rendered using RESTAPIs with the help of script editor web part in the page.

For share functionality I have used below code

function SharePage() {
    EnsureScriptFunc('sharing.js', 'DisplaySharingDialog',
        function() {
            DisplaySharingDialog(_spPageContextInfo.webAbsoluteUrl, _spPageContextInfo.pageListId, _spPageContextInfo.pageItemId.toString());

But using this I can share only the page, not the list and list items. Is there any work around for this?


Your approach should work, however _spPageContextInfo.pageListId and _spPageContextInfo.pageItemId may be emtpy. I think they are only available in item-details or edit pages...

You'd need the "right" URLs for your idea.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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