DHTMLX / scheduler

GPL version of JavaScript Event Scheduler
https://dhtmlx.com/docs/products/dhtmlxScheduler/
GNU General Public License v2.0
319 stars 111 forks source link

Custom lightbox on error #41

Closed djoey123 closed 2 years ago

djoey123 commented 6 years ago

I got some problems with an custom lightbox. Maybe someone could help me with it.

while creating an new event, if the server reports an error, and i click close, the Event is not removed from the Scheduler, it keeps existing.

next problem: If i check the custom lightbox with an input check:

dp.attachEvent("onBeforeUpdate", function(id, state, data){

            if(data.activiteit === "" || data.project === "") {
                alert('Fill all fields!');
                scheduler.startLightbox(id, null);
                scheduler.hideCover(scheduler.getLightbox());
                return false;
            }

            return true;
        });

It checks with succes, but if i save the event again, it reports ev not defined.

function save_form() {
        console.log(scheduler.getState());
        const ev = scheduler.getEvent(scheduler.getState().lightbox_id);
        ev.project = html("project").value;
        ev.activiteit = html("activiteit").value;
        ev.explanation = html("toelichting").value;
scheduler.endLightbox(true, null);

When i check the state after onBeforeUpdate, it shows that lightbox_id is NULL.

i fixed the first problem with an global var... not the best way

Still got no good solution for problem 2

djoey123 commented 6 years ago

Fixed for me with this changes in source https://github.com/djoey123/scheduler/commit/c19577fc73de0755174cfd8073abc95a39402625

ArtiBorisevich commented 2 years ago

The issue is closed due to inactivity. If anybody still has this issue - please feel free to reopen, but please be sure to provide enough info to reproduce the issue - it can be either a standalone zip package with demo, or a demo made using our snippet tool http://snippet.dhtmlx.com/29dd2e6d4