Just a quick background explanation:
The "onclick" event has been replaced by "onClick" in version 8.3.2617:
https://javascript.daypilot.org/daypilot-pro-for-javascript-8-3-sp6/
The new onClick event uses standard DayPilot args object as an argument (to make it compatible with other DayPilot events), while onclick uses the JavaScript behavior (it's invoked on the source menu item object).
If you are using an older version, "onClick" may not be available. (The sample project includes DayPilot Pro version 2018.2.3324.)