search envelope-o feed check
Home Unanswered Active Tags New Question
user comment-o

ContextMenu Javascript action with Callback in Scheduler not working

Asked by Tom
12 years ago.
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);" />

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.

Comment posted by Dan Letecky
12 years ago.
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
12 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 man
12 years ago.

i am not getting e.resourceid here

This question is more than 3 months old and has been closed. Please create a new question if you have anything to add.