I use Adam Shaw control FullCalendaralong with jQuery. I would like to add a context menu to events and days. I was able to achieve this using Content Management in the Martin Wendt menu . My code for registering a menu in events is as follows:
$('#calendar').fullCalendar({
eventRender: function (event, element) {
var originalClass = element[0].className;
element[0].className = originalClass + ' hasmenu';
},
dayRender: function (day, cell) {
var originalClass = cell[0].className;
cell[0].className = originalClass + ' hasmenu';
});
});
I add a class hasmenuto each event and day on the calendar.
$(document).contextmenu({
delegate: ".hasmenu",
preventContextMenuForPopup: true,
preventSelect: true,
menu: [
{title: "Cut", cmd: "cut", uiIcon: "ui-icon-scissors"},
{title: "Copy", cmd: "copy", uiIcon: "ui-icon-copy"},
{title: "Paste", cmd: "paste", uiIcon: "ui-icon-clipboard", disabled: true },
],
select: function(event, ui) {
},
beforeOpen: function(event, ui) {
}
});
The problem is that the menu appears behind the calendar control. I believe that this is due to the fact that in calendar events there are several other classes assigned to them, and adding a class is hasmenumessing with them. When I set a breakpoint in VS, it says the event has these classes:
"fc-event fc-event-hori fc-event-draggable fc-event-start fc-event-end hasmenu"
And this is how it looks on the page:

hasmenu, , . ? " "? .