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:
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?
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?