Created
June 27, 2018 16:20
-
-
Save vaderj/e70330b449dd2e727dd293c5ee0c7efd to your computer and use it in GitHub Desktop.
Disable the double click event listeners for the SharePoint calendar (that creates a new item) #Javascript #SharePoint
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Disable the dblclick event listener which creates a new item on the calendar | |
ExecuteOrDelayUntilScriptLoaded(MyCalendarHook,'SP.UI.ApplicationPages.Calendar.js'); | |
function MyCalendarHook(){ | |
var calendarCreate = SP.UI.ApplicationPages.CalendarContainerFactory.create; | |
SP.UI.ApplicationPages.CalendarContainerFactory.create = function (elem,cctx,viewType,date,startupData) { | |
cctx.canUserCreateItem = false; | |
calendarCreate(elem, cctx, viewType, date, startupData); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment