This is my approach to expand all calendar events on load, but if you have a better way, please share!
On the calendar page, add a reference to jQuery and also place a style tag to hide the "expand/collapse" links on load:
Hook into the existing SharePoint calendar load function:
On the calendar page, add a reference to jQuery and also place a style tag to hide the "expand/collapse" links on load:
<style> .ms-cal-nav{display:none;} </style>
Hook into the existing SharePoint calendar load function:
_spBodyOnLoadFunctionNames.push('changeCalendarEventLinkIntercept');
function changeCalendarEventLinkIntercept() { var OldCalendarNotify4a = SP.UI.ApplicationPages.CalendarNotify.$4b; SP.UI.ApplicationPages.CalendarNotify.$4b = function () { OldCalendarNotify4a(); changeCalendarEventLinks(); } }In the function call, find all anchor tags with the attribute evtid marked as 'expand_collapse' and click on the hyperlink:
function changeCalendarEventLinks() { //expand all $("a[evtid='expand_collapse']").each(function(){ $(this)[0].click(); }); }
Does this work for Office 365?
ReplyDeleteI tried it but could not get it to work.
Have you placed a jquery reference before this script?
ReplyDeleteThis comment has been removed by the author.
ReplyDeleteIt seems clean until I paste in the last section. Then I get "server tag is not well formed".
ReplyDelete----------------
function changeCalendarEventLinks()
{
//expand all
$("a[evtid='expand_collapse']").each(function(){
$(this)[0].click();
});
}
Thanks, that saved me some time :-)
ReplyDelete