我试图用[Jquery FullCalendar]实现[Jquery上下文菜单],我的问题是上下文菜单显示在我的事件后面:
请参阅creenshot: http://1drv.ms/1Fa8qKp
它是员工DTR的日历。
这是我的JS代码:
CONEXT MENU JS
$(function () {
$.contextMenu({
selector: '.fc-day, .fc-event',
callback: function (key, options) {
var m = "clicked: " + key;
window.console && console.log(m) || alert(m);
},
items: {
"ApplyLeave": { name: "Apply Leave", icon: "" },
"ApplyOT": { name: "Apply Overtime", icon: "" },
"ApplyOB": { name: "Apply Official business", icon: "" },
"sep1": "---------"
},
// TO MAKE CONTEXT TOPMOST
beforeOpen: function (event, ui) {
ui.menu.zIndex($(event.target).z);
}
});
$('.context-menu-one').on('click', function (e) {
console.log('clicked', this);
})
});
CALENDAR JS CODE
$('#calendar').fullCalendar({
header:{
left: 'prev,next today',
center: 'title'
//right: 'month'
},
theme: true,
defaultView: 'month',
editable: false,
allDaySlot: true,
selectable: true,
events: "/Calendar/GetEventsDTR/",
eventRender: function (event, element) {
element.find('.fc-event-title').append(event.timeInTimeOut);
//element.qtip({
// content: event.Note
//});
},
loading: function (bool) {
if (bool) {
$('.fc-header-title').hide();
$('#loadingImg').show();
}
else{
$('#loadingImg').hide();
$('.fc-header-title').show();
}
},
});