This is a migrated thread and some comments may be shown as answers.

Cancelling OnClientAppointmentContextMenuItemClicked events

2 Answers 73 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Matthew
Top achievements
Rank 1
Matthew asked on 22 Feb 2011, 11:22 AM
Hi there,

In my appointment context menu, I have a delete menu item that I would like to cancel if the user does not confirm that they are sure they want to delete this item.  However, the args argument for OnClientAppointmentContextMenuItemClicked does not seem to have a "set_cancel" method in the same way as is the case on the OnClientAppointmentDeleting.  Here is what I am trying to do:

function onAppointmentContextMenuItemClicked(sender, args) {
    switch (args.get_item().get_value()) {
        case "CommandDelete":
            if (args.get_appointment().get_id().startsWith('booking'))
                type = "booking";
            else if (args.get_appointment().get_id().startsWith('fixture'))
                type = "fixture"; 
            if (!confirm("Are you sure you want to delete this " + type)) {
                args.set_cancel(true);
            }
            break;
    }
}

There is no set_cancel event on the args object, so I can't see how to cancel the callback to the server.  Can you tell me how I can cancel it?

2 Answers, 1 is accepted

Sort by
0
Accepted
Veronica
Telerik team
answered on 22 Feb 2011, 01:43 PM
Hi Matthew,

You need the OnClientAppointmentContextMenuItemClicking event to be able to cancel it via asrgs.set_cancel(true) as it fires before OnClientAppointmentContextMenuItemClicked.

Greetings,
Veronica Milcheva
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
0
Matthew
Top achievements
Rank 1
answered on 22 Feb 2011, 02:18 PM
Thanks Veronica
Tags
Scheduler
Asked by
Matthew
Top achievements
Rank 1
Answers by
Veronica
Telerik team
Matthew
Top achievements
Rank 1
Share this question
or