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

Stopping context menu from showing.

2 Answers 64 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Alan
Top achievements
Rank 1
Alan asked on 08 Feb 2011, 09:43 AM
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 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 08 Feb 2011, 01:28 PM
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.
0
Alan
Top achievements
Rank 1
answered on 08 Feb 2011, 01:35 PM
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
Tags
Scheduler
Asked by
Alan
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Alan
Top achievements
Rank 1
Share this question
or