Hello, I've a problem: I want add an item in the context menu with javascript action, but I don't work:
<DayPilot:DayPilotCalendar ID="DayPilotCalendar1" ContextMenuID="DayPilotMenu1" ClientObjectName="dpc1" runat="server"
Days="1" TimeFormat="Clock24Hours" HeaderDateFormat="D"
DataValueField="key" DataTextField="subject" DataEndField="end" DataTagFields="tag" DataStartField="start" DataSource="<%# getData %>"
OnBeforeEventRender="DayPilotCalendar1_BeforeEventRender"
TimeRangeSelectedHandling="PostBack" OnTimeRangeSelected="DayPilotCalendar1_TimeRangeSelected" OnEventMenuClick="DayPilotCalendar1_EventMenuClick"
EventClickHandling="PostBack" OnEventClick="DayPilotCalendar1_EventClick"
HeaderClickHandling="PostBack" OnHeaderClick="DayPilotCalendar1_HeaderClick"
EventDeleteHandling="PostBack" OnEventDelete="DayPilotCalendar1_EventDelete" DurationBarColor="#666666">
</DayPilot:DayPilotCalendar>
<DayPilot:DayPilotMenu ID="DayPilotMenu1" ShowMenuTitle="true" MenuTitle="Appuntamento" runat="server">
<DayPilot:MenuItem Text="Modifica" Action="PostBack" Command="Modifica" />
<DayPilot:MenuItem Text="Duplica" Action="PostBack" Command="Duplica" />
<DayPilot:MenuItem Text="Cancella" Action="PostBack" Command="Cancella" />
<DayPilot:MenuItem Text="Cancella (Javascript)" Command="Cancella" Action="JavaScript" JavaScript="if (confirm('Do you really want to delete this event (' + e.text() + ')?'))dpc1.eventMenuClickCallBack(e, command);" />
</DayPilot:DayPilotMenu>
I fill example at this link
http://www.daypilot.org/context-menu.html but I haven't understood like declaring the
eventMenuClickCallBack...
I would want that to the event Javascript it made this:
protected void DayPilotCalendar1_EventMenuClick(object sender, DayPilot.Web.Ui.Events.EventMenuClickEventArgs e)
{
if (e.Command == "Modifica")
{
Response.Redirect("ModApp.aspx?key=" + e.Value + "&day=" + e.Start.ToString("d"));
//DayPilotCalendar1.DataBind();
}
if (e.Command == "Duplica")
{
DuplicaPlanner(e.Value);
DayPilotCalendar1.DataBind();
}
//cancella un evento
if (e.Command == "Cancella")
{
//Response.Write(e.Value);
CancellaPlanner(e.Value);
DayPilotCalendar1.DataBind();
}
}
Thanks.