When I right-click on an event the contextmenu shows up as plain text above (outside) the entire scheduler. I’ve attached a screenshot to show the problem. How do I get it beside the event?
Here’s is the code that appears in my init() function after scheduler.load()
var menu = new dhtmlXMenuObject();
menu.setIconsPath('/content/css/scheduler/imgs/');
menu.renderAsContextMenu();
menu.loadXML(Cal.cm.dataXml + '?e=' + new Date().getTime());
scheduler.attachEvent('onContextMenu', function (event_id, native_event_object) {
if (event_id != null) {
var ev = scheduler.getEvent(event_id);
if (ev.type != 'UN-Available') {
var posx = 0;
var posy = 0;
if (native_event_object.pageX || native_event_object.pageY) {
posx = native_event_object.pageX;
posy = native_event_object.pageY;
}
else if (native_event_object.clientX || native_event_object.clientY) {
posx = native_event_object.clientX + document.body.scrollLeft
+ document.documentElement.scrollLeft;
posy = native_event_object.clientY + document.body.scrollTop
+ document.documentElement.scrollTop;
}
menu.showContextMenu(posx - 1, posy - 1);
}
}
});
menu.attachEvent('onClick', Cal.cm.clicked);