I created a contentType in the calendar list and then I created a page with a week view for those contentType items.

Now when someone clicks on a time slot to create a new item for the calendar it defaults to the original Event content type instead of the newly created one. So to solve this I created a content editor web part on the page with the following javascript to override the function

<script type="text/javascript">

window.ClickTime = function(sourceURL, urlTime){

     alert('clicked' + sourceURL + ' ' + urlTime);
     var url = sourceURL + '?CalendarTime=' + urlTime + '&ContentTypeId=0x0112315EF8B9141AEDAC0008BA02586654D60FF0A5F76272ED939F4DAC57F42F38936B52&source=' + document.URL ;
    window.location = url; 


Now this is where things get weird. When I'm in edit page mode it works perfectly, but outside of edit page mode it still goes to the default contentType. I've tried putting the webpart in first and last and still nothing.

1 Answer 1

document.ClickTime = function

This is what worked for me.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.