Posts

Showing posts from September, 2012

Open Document directly in Edit Mode within SharePoint from an Email link

Image
If you send a link to a SharePoint document with Email to another user, the document is opened in read only mode. It is not possible to open it directly in Edit Mode. Therefore I wrote a little JavaScript which can do that easily. Steps to implement: 1.) Create a new page on the sitecollection you want to have this ability. Name it OpenDoc. 2.) Add the "XML-Viewer" WebPart from "Content Rollup" category. 3.) Open the WebPart Settings of the XML-Viewer WebPart 4.) Click on XML-Editor Button and add following JavaScript into it: <script type="text/javascript"> ExecuteOrDelayUntilScriptLoaded(LoadDoc, "sp.js"); function LoadDoc() { JSRequest.EnsureSetup(); var file = JSRequest.QueryString["file"]; if (typeof file != "undefined" && file != "") { var baseUrl= " http://sharepoint/sites/mysite "; var host = location.protocol + "//" + location.host; ...

Open SharePoint 2010/2013 Display, Edit, New Forms in Modal Dialogs

Image
If you want to open a SP 2010 or in SP 2013 list item in a modal dialog you have two choices. Using the standard JavaScript functions or creating own functions. How to find which item URL is called If the dialog box appears you don't have an address bar to pick up the called URL. To see which URL is called when you edit or open a list item use the Internet Explorer Developer Tools. Open your source list in the Internet Explorer. Press F12 to open the developer tools. Click on the "Network" tab and then on "Start Capturing" Now click the link you want to track. You'll see the requests listed and you can also copy the urls for your need. SharePoint usually calls the /_layout/listform.aspx with the list parameter. The form then redirects to the appropriate list form. Method 1: Using core functions When using SharePoint 2010 core javascript functions to open elements in dialogs mostly you'll need to know : the ID of the l...