I built a calendar that shows both individual events and “company” events. When someone is logged in as an individual, they can view but not modify the “company” events. I built my own lightbox to handle this.
My issue is that I made it so onBeforeDrag does a test to see if the person has access to an event, and if not, I show an alert. It works really well in the day and week views.
The problem is that in the month view, trying to double click the event calls onBeforeDrag before either onClick or onDoubleClick is called. So, there is no way for people to view these events. They keep getting the warning that they do not have access to edit it.
Is there a way to maybe ignore the drag event only in month view? I have version 2.1. I saw a “getState” method but dont’ think that I have it.
If you click any event in the month view then onBeforeDrag, onClick internal events will be triggered (in that order).
So you can simply block drag in the month view by returning false value.
Updated code:
scheduler.attachEvent("onBeforeDrag", function (event_id, mode, native_event_object){
if(scheduler._mode != "month") {
// custom logic for other than month views
}
else { // month view
return false; // we are blocking drag event, onClick will be triggered next
}
});
Hope this helps.
Get a guaranteed answer from DHTMLX technical support team
under the most suitable support plan