Stopping context menu from showing.

3 posts, 0 answers
  1. Alan
    Alan avatar
    107 posts
    Member since:
    Oct 2010

    Posted 08 Feb 2011 Link to this post

    Hi,

    I need to stop the context menu from displaying in certain situations (client-side of course). I tried using OnContextMenu, but I'm not sure if telerik's context menu supports being stopped.

    function OnClientContextMenu(sender, args) {
        var appointment = args.get_appointment();
        if (appointment)
        {
            if(appointment.get_attributes().getAttribute("Status") != 2 || appointment.get_attributes().getAttribute("Status") != 3) {
                //Stop context menu from showing.
                return;
            }
            else
            {
                //Show context menu.
                menu.show(args.get_domEvent());
            }
        }
    }

    Thank you for your help.

    Daryl

    Edit: Method is attached to this event:

    OnClientAppointmentContextMenu="OnClientContextMenu"
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 08 Feb 2011 Link to this post

    Hello,



    Have you tried setting the ContextMenuID to a non existing ID for the appointments which you do not want to show context menu?
    Here is the forum which discussed about similar requirement.
    How to disable the context menus



    -Shinu.
  3. Alan
    Alan avatar
    107 posts
    Member since:
    Oct 2010

    Posted 08 Feb 2011 Link to this post

    In theory I think that's the solution. Unfortunately it throws a javascript exception. I guess it's a bug though. I'm going to create a support ticket.

    Thanks,
    Daryl
Back to Top