Previously, I shared about how to create a color coded calendar, and then taking that calendar a little further and jazzing it up with some color. One issue that has been identified with this method, and using calendar overlays in general, is the fact that the events open in a whole new window. Not cool.
After reading through the thread, I’ve compiled the follow block of code. You can throw this in the same web part that contains your CSS.
NOTE A few people have reported this doesn’t work in SharePoint 2013. I’ll find a solution. ;)
NOTE: Update the first line to your jQuery file if you have it somewhere on your network/site already.
Yikes! Not sure on this one. Try throwing the calendar web part on a new page and add a few overlays and see if it works there, just to rule out a bigger issue with the list. Try removing all of your custom code and css and see what happens, does it all return to normal?
If I delete the HTML Form web part the calendar comes back.
Ok great. Send me the code that’s in that web part and I’ll see if I can determine what might be the problem. Email me david.lozzi at slalom.com
I am assuming that this still doesn’t work in Sharepoint 2013? The really annoying part is that it opens a new tab and when you click on the Close button it returns you to the Calendar…in the same tab, leaving two tabs with the calendar open.
When I clicked on Download the script it took to a different page. Can you please send me the code for fixing the overlays?
Not sure where the script is, have you tried the script as it is above in the blog post itself? I’ll remove the download link
I downloaded the script… where is it located in the file? Also, am I meant to paste the code into all together? I know nothing when it comes to this stuff so I really need the Where to Paste For Dummies version haha
Found the codes from this site that work with your color calendar script in SharePoint Online, (possibly 2013 also), with the exception of the first-color overlay event does not work.
Can you take a look?
i am using SHP 2013 Foundation. I have added you code into Script editor webpart, but it keeps open in new tab. Do you have any suggestions?
Thank you for you reply.
Hi David, did you find a solution for Sharepoint 2013? Thanks.
I checked and no errors and when I say new windows I may of miss spoken. I put your script into a web part, if I remove it clicking an event opens a new tab. If I keep you script in the web-part, clicking the event opens the event but is the same window that I was in but not as a pop-up modal box.
Let me know your thoughts if need be I can take screen shots or video. thanks.
Script is working ok for me. But instead of opening up a modal it opens a new page, better than a new tab, but when I hit close it takes me back to todays date not the month I was on. Is there any way to get a Modal to open on top of everything?
What version of SharePoint?
It sounds like it’s not working at all, as opening in a new window is default for SP overlays. Check the console for errors, see this post for more detail on how: http://davidlozzi.com/2013/05/15/a-non-developers-intro-to-the-developer-toolbar-scripting/. Let me know what you get
I got this error: SP.UI.ApplicationPages.CalendarNotify is undefined.
We use sharepoint 2013 for public website. So I would like to know if your code only worked for Team Site, not for Publishing site.
Office 365 or SharePoint 2013 onprem?
SharePoint 2013 On Premise
Unfortunately I haven’t fixed this script for SharePoint 2013 yet. This is definitely 2010 specific
Thanks a lot for this solution and your color coding solution. They fixed the problem, but I noticed that this script seems to break after you edit the site in SharePoint Designer.
After opening the site in SharePoint Designer, creating a workflow, and saving changes, the script no longer works and the items open in new tabs again. I noticed that instead of , the first line of the code changes to . For some reason the “//ajax.googleapis.com” part of your script source gets stripped out.
Any idea why this is happening or how to fix it?
This is in SP 2010.
You should be able to append the correct protocol to the start of the URL, like http://ajax… or https://ajax. The correct protocol will be whatever protocol your site is using for users to access it. The lack of the protocol allows the browsers to auto-switch from http to https as needed. Apparently SPD doesn’t like that, big surprise.
Let me know how it goes.
Hi David. Thanks for the quick reply. After I posted my question, I noticed the same thing was happening not only when I edited the page in SPD, but also when I made changes to the list or the pages in the browser, too. I just added the protocol and it seems to have fixed the problem. Hopefully it’ll stay working. I’ll keep you posted. Thanks again!