"CommandHandler is not a function" JavaScript error
Asked by Dan Letecky
19 years ago.
19 years ago.
This JavaScript error can appear when you upgrade DayPilot Pro 3.5 to DayPilot Pro 3.6. It is caused by a changed JavaScript API for calling server-side EventMenuClick event from JavaScript (using AJAX callback or PostBack).
This example asks the user for confirmation before the menu action is executed.
Old syntax:
See also the documentation for context menu.
This example asks the user for confirmation before the menu action is executed.
Old syntax:
<DayPilot:MenuItem Action="JavaScript" Command='Delete'New syntax:
JavaScript="if (confirm('Do you really want to delete this event?'))
ctl00_ContentPlaceHolder1_DayPilotCalendar1.CommandHandler('Delete', '{0}', '{1}');"
Text="Delete" />
<DayPilot:MenuItem Action="JavaScript" Command='Delete'
JavaScript="if (confirm('Do you really want to delete this event?'))
ctl00_ContentPlaceHolder1_DayPilotCalendar1.eventMenuClickCallBack(e, command);"
Text="Delete" />
See also the documentation for context menu.
DayPilot