SharePoint 2013 Overlay Events to be Opened on Popup


 Yesterday we got a customer request that asked us to make all events on SharePoint calendar list to be opened on popup instead of open it on a new page

 We simply go to list setting and change dialog setting from list’s advanced settings. However this is doesn’t work for overlay events and continued to open it on a new tab

 We found a lot of solution using java-script on the internet, but none of them has worked for us.

 After we mixed some solutions we make the following code to solve this problem:

Note: You must include JQuery library to your code.

//Open popup function
function openDialog(pUrl) {
     var options = {
          title : "Calendar",
          width : 600,
          height : 400,
          url : pUrl
     SP.SOD.execute("sp.ui.dialog.js", "SP.UI.ModalDialog.showModalDialog", options);

//Change the displayed events to open in a popup
              $(".ms-acal-rootdiv a").each(function (){
              var parent =            $(this).parent().parent();
              var url = $(this).attr("href");
               return $("<span>" + $(this).html() + "</span>");

   } ,1000);

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s