Posts

Showing posts from December, 2013

Sharing a Page using JavaScript Object Model

Last week I was given a task to implement Share functionality using client side scripts. First I tried to search on the blogs but I didn’t find anything. So, I used IE developer tool to find out how SharePoint is calling Share from ribbon but no luck with it also. But I’m able to find the JavaScript function called on the click of “Shared With”. That is in Sharing.js that’s the main breakthrough. I opened the Sharing.debug.js to find out functions defined in that file. Then I find the function “ DisplaySharingDialog (webUrl, listId, listItemId) ” that is used to open the dialog box for sharing users. function SharePage(){ EnsureScriptFunc('sharing.js', 'DisplaySharingDialog', function () { DisplaySharingDialog(_spPageContextInfo.webAbsoluteUrl, _spPageContextInfo.pageListId, _spPageContextInfo.pageItemId.toString());                 }); } Since this function is defined in Sharing.js file that...