Home Unanswered Active Tags New Question

ContextMenu Javascript action with Callback in Scheduler not working

Hi Dan,

I have this unusal problem, I have followed the examples and also looked at you online demo code to but still having no success. The javascript only function works but the callback in the Javascript isn't.

This is my Context Menu
<DayPilot:DayPilotMenu ID="RoomBookingWizardContextMenu" runat="server">
<DayPilot:MenuItem Text="Edit booking" Action="JavaScript" JavaScript="editBooking('{0}');" />
<DayPilot:MenuItem Text="Cancel Booking" Action="JavaScript" Command="Delete" JavaScript="if (confirm('Do you really want to cancel the booking ' + e.text() + ' ?')) RoomBookingWizardScan.eventMenuClickCallBack(e, command);" />
</DayPilot:DayPilotMenu>

This is in my class:

protected void RoomBookingScanWindow_EventMenuClick(object sender, DayPilot.Web.Ui.Events.EventMenuClickEventArgs e)
{
int bookingSeq = Convert.ToInt32(e.ResourceId);

if (e.Command == "Cancel")
{
//my function will go here
}
}

I have run the site in Debug mode and placed a breakpoint at the EventMenuClick but nothing, it never hits the breakpoint.

Any ideas will be much appreciated as I am beginning to pull more and more hair out.

Tom
Asked by Tom 4 years ago.
Replies
Can you post your DayPilotCalendar aspx declaration as well?

The first thing I would check is that ClientObjectName attribute of the DayPilotCalendar control is set to "RoomBookingWizardScan". Although the auto-generated client object name is the same as the object ID on the server side in most cases, it is different when you are using master pages or put DayPilotCalendar into .ascx file.
Comment posted by Dan Letecky 4 years ago.
If you were putting the breakpoint inside the if (e.Command ...) {} block you should also try changing it to if (e.Command == "Delete") {}.
Comment posted by Dan Letecky 4 years ago.

i am not getting e.resourceid here

Comment posted by man 3 years ago.
New Reply
This reply is
Your name (optional):

DayPilot for ASP.NET WebForms, DayPilot for ASP.NET MVC, DayPilot for Java