DHTMLX Scheduler Save Not Called in IE11 & Firefox

I have DHTMLX Scheduler ASP.Net Commercial and support was only for 1 month. I never needed to ask anything but now have a problem and this support has run out.

I have a calendar which does not seem to call the Save method in IE11 and Firefox. It works fine in IE8,9,10 and Chrome. I just cant seem to find what is wrong. The calendar loads fine but when saving in IE11 or Firefox it does not go into the Save method to save back to the database. I have debug points set but it just seems to miss the Save method altogether.

Any help would be appreciated?

Thanks.

Hi,
do you receive any js errors in browser console?
I’ve just checked the example from NuGet in FF, it works quite normally.
Could you attach a small demo project where we could reproduce the issue?

Hi Aliaksandr,

I’ve managed to narrow it down to the code causing this:

The code below will redirect from the calendar to a separate page depending on the caseID value when adding and editing events. When this code is on the page, events don’t get saved or updated? Not sure why? I don’t receive any JS errors either. Thanks.

Code in the MVC View:

        // onEventAdded
        scheduler.attachEvent("onEventChanged", function (event_id, mode) {
            if (caseID != "0") {
                location.href = "/Manage/Case/Detail/" + caseID;
            }
            if (caseID == "0") {
                location.reload();
            }
        });
        
        //New event
        scheduler.attachEvent("onEventAdded", function (id, ev) {
            if (caseID != "0") {
                location.href = "/Manage/Case/Detail/" + caseID;
            }
            if (caseID == "0") {
                location.reload();
            }
        });

scheduler.attachEvent("onEventChanged", function (event_id, mode) { if (caseID != "0") {
If this is the exact code that you use on the page, I believe you can see the following error message in browser console (Chrome):

Id of the appointment is passed as ‘event_id’, and ‘caseID’ seems to be never defined. Check the function declaration above.
Js error breaks the further processing, so events never gets saved.

Also, if you need to open details page of the modified event, it may be better to do after changes are saved to the server. There is an inner component that responsible for server-side comunication (dhtmlxDataProcessor).
It fires an event when receives confirmation from the server that changes has been saved (as a small benefit, you can have a single event handler for both operations).
Here is the code :scheduler.dataProcessor.attachEvent("onAfterUpdate", function(sid, action, tid, tag){ if (action == "updated" || action == "inserted"){ location.href = "/Manage/Case/Detail/" + tid; } });
docs.dhtmlx.com/doku.php?id=dhtm … cessor:toc
docs.dhtmlx.com/doku.php?id=dhtm … fterupdate

Hi Aliaksandr,

I’ve got it working. The caseID variable is on the page, further up (sorry i didnt mention) so it exists and does not error on that.

The fix was as you suggested to use :

scheduler.dataProcessor.attachEvent(“onAfterUpdate”, function(sid, action, tid, tag){
if (action == “updated” || action == “inserted”){
location.href = “/Manage/Case/Detail/” + tid;
}
});

I placed the original code I had in this event handler for the caseID and it started to work.

Thanks for your help with this!! :smiley: