search envelope-o feed check
Home Unanswered Active Tags New Question
user comment-o

Edit Event does not fire in Chrome unless DevTools is started

Asked by Frank Sandersen
5 years ago.

The click event is not fired in Chrome unless DevTools is started.
For other browser like IE and Firefox I have no problems with this.
See attached MVC code file. Basically I inserted an alert statment in the click event to verify that it has been fired. This alert box does not show up in Chrome (unless I have pressed F12 first)

I appreciate help on this. Thanks!

Comment posted by Frank Sandersen
5 years ago.

After more investigations I see that my problem is that the Move event is fired when the Click event should be fired. Same problem as in this question:
https://forums.daypilot.org/Topic.aspx/4124/in-a-month-calendar-in-chrome-when-clicking-on-an-event-the

Answer posted by Frank Sandersen
5 years ago.

Fortunately, I found a workaround by using these JS events:

dpc.onEventMove = function (e, newStart, newEnd) {
eventChange(e, newStart, newEnd);
};

dpc.onEventResize = function (e, newStart, newEnd) {
eventChange(e, newStart, newEnd);
};

function moveEvent(id, newStart, newEnd) {
$.post("@Url.Content("~/MeetingRoomDialog/Move")" + "?Id=" + id + "&NewStart=" + newStart + "&NewEnd=" + newEnd , function (result) {
if (eval(result) != "OK") {
bootbox.alert({ title: "Error", message: eval(result) });
}
else {
dpc.commandCallBack('refresh');
}
});

};

Comment posted by Frank Sandersen
5 years ago.

Sorry, I forgot this methid in the answer above:

function eventChange(e, newStart, newEnd) {
if (!e.isEvent) {
return false;
}
else if (e.data.start.value == newStart.value && e.data.end.value == newEnd.value) {
//If no chamges in start and end - we assume edit event
editEvent(e.data.id);
}
else {
moveEvent(e.data.id, newStart.value, newEnd.value)
}
}

This question is more than 1 months old and has been closed. Please create a new question if you have anything to add.