i am trying to create a copy-paste feature using context menu as displayed here: https://doc.daypilot.org/scheduler/event-copying/
how do i get the following event to fire?
protected void DayPilotScheduler1_Command(object sender, CommandEventArgs e)
{
switch (e.Command)
{
case "paste":
DateTime pasteHere = (DateTime) e.Data["start"];
string id = (string) e.Data["id"];
// find the event using id
// create a new database record using the original event properties
DayPilotScheduler1.DataSource = loadEvents(); // your method, load events from database
DayPilotScheduler1.DataBind();
DayPilotScheduler1.UpdateWithMessage("Event copied.");
break;
}
}
i have added on my daypilot the following:
ContextMenuSelectionID="DayPilotMenuSelection"
AND
<DayPilot:DayPilotMenu ID="DayPilotMenuSelection" runat="server" CssClassPrefix="menu_default">
<DayPilot:MenuItem Action="JavaScript" JavaScript="if (!copied) { alert('You need to copy an event first.'); return; } dps.commandCallBack('paste', {id:copied, start: e.start});" Text="Paste" />
</DayPilot:DayPilotMenu>
do i need to add something more? like oncontextmenuclick = ….