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

[Solved] Dynamic RadContextMenu in scheduler

1 Answer 117 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Julia Shah
Top achievements
Rank 1
Julia Shah asked on 10 Aug 2009, 10:34 PM
Hi,

I would like to add context menu to my scheduler dynamically - based on one of the custom attributes to show different menu items for each appointment. Is it possible? I couldn't find any examples for this scenario.

Thanks,
Julia

1 Answer, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 11 Aug 2009, 12:55 PM
Hi Julia,

I suggest you hide specific menu items on the client based on the value of the apponitment's custom attribute. For example, using the Context Menu demo, suppose you have a Description custom attribute and you need to hide the first first item in the menu from the "categorize" list - "Development". You can use the following code:
function appointmentContextMenu(sender, eventArgs)  
                {  
                    var menu = $find("<%= SchedulerAppointmentContextMenu.ClientID %>");  
                    selectedAppointment = eventArgs.get_appointment();  
                    if (selectedAppointment.get_attributes().getAttribute("Description") == "non development") {  
                        menu.findItemByValue("1").set_visible(false);  
                    }  
                    checkResourceMenuItem(menu, selectedAppointment);  
                    menu.show(eventArgs.get_domEvent());  
                } 




Sincerely yours,
Peter
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Scheduler
Asked by
Julia Shah
Top achievements
Rank 1
Answers by
Peter
Telerik team
Share this question
or