Cancelling OnClientAppointmentContextMenuItemClicked events

3 posts, 1 answers
  1. Matthew
    Matthew avatar
    26 posts
    Member since:
    Dec 2007

    Posted 22 Feb 2011 Link to this post

    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. Answer
    Veronica
    Admin
    Veronica avatar
    1213 posts

    Posted 22 Feb 2011 Link to this post

    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!
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Matthew
    Matthew avatar
    26 posts
    Member since:
    Dec 2007

    Posted 22 Feb 2011 Link to this post

    Thanks Veronica
Back to Top