Then I used the below code in my page(where calendar control presents) using content editor webpart.
// load our function to the delayed load list
_spBodyOnLoadFunctionNames.push('calendarEventLinkIntercept');
// hook into the existing SharePoint calendar load function.
function calendarEventLinkIntercept()
{
if (SP.UI.ApplicationPages.CalendarNotify.$4a)
{
var OldCalendarNotify = SP.UI.ApplicationPages.CalendarNotify.$4a;
SP.UI.ApplicationPages.CalendarNotify.$4a = function ()
{
OldCalendarNotify();
bindEventClickHandler();
}
}
if (SP.UI.ApplicationPages.CalendarNotify.$4b)
{
var OldCalendarNotify = SP.UI.ApplicationPages.CalendarNotify.$4b;
SP.UI.ApplicationPages.CalendarNotify.$4b = function ()
{
OldCalendarNotify();
bindEventClickHandler();
}
}
// future service pack change may go here!
// if (SP.UI.ApplicationPages.CalendarNotify.???)
}
function bindEventClickHandler() {
$('.ms-acal-rootdiv a').click(function(){EditLink2(this,'WPQ2');return false;});
}
All overlay were opening in modal dialog :) [Just copy and paste the code]
Note: Find your calendar control's 'WPQ#' and replace the 'WPQ2' in bindEventClickHandler() with your 'WPQ#'. For some control the number changes. Ex: If you control with 'WPQ3' then replace 'WPQ2' with 'WPQ3' in bindEventClickHandler(). You can find that number in status bar of your browser on mouse over the month changing arrows.
Hi there,
ReplyDeleteIt did not work for me.
Do I have to add anything else?
JF
This comment has been removed by the author.
ReplyDeleteIt did't work for me either.
ReplyDeleteI've made sure that calendar WPQ3 matches one in script but no luck.
Any idea? Thanks
You have to add a reference to jQuery before this script. Put this before the code:
ReplyDeletescript src="//ajax.googleapis.com/ajax/libs/jqueryui/1.9.2/jquery-ui.min.js"> script
NOTE: Put script tags around the code!
You can also download the jquery file and put it where ever you want, just make sure to update the reference.
This doesn't work. First blush looks good, but if you open a link from a view and then return to the calendar and click a link in the main view, the dialog popos up and goes gray and focus is lost. I think you're missing a step to reset events on completion.
ReplyDeleteKindly elaborate !
Delete