Closing Lightbox Confirmation Not Showing

Hello,

I am having an issue with the confirmation not appearing when closing the lightbox.

I have a scheduling.js file that is included on my schedule that add the label to the locale.

scheduler.locale.labels.confirm_closing = "Hello. Are you sure you wish to cancel? Any changes made to this appointment will be lost.";

This appears to do nothing.

Here is the full function:

function defineScheduleLabels() { scheduler.locale.labels.confirm_closing = "Hello. Are you sure you wish to cancel? Any changes made to this appointment will be lost."; scheduler.locale.labels.confirm_deleting = "You're deleting me"; scheduler.locale.labels.unit_tab = "Day"; scheduler.locale.labels.section_assessment_type = "Appointment Type"; scheduler.locale.labels.section_patient = "Patient <div style='float:right;margin-right: 10px;'>Location: <span style='color: red'>" + parent.$('LocationHeaderName').innerHTML + "</span></div>"; scheduler.locale.labels.section_time = "Time"; scheduler.locale.labels.section_technician_name = "Clinician"; scheduler.locale.labels.section_notes = "Notes"; scheduler.locale.labels.section_appointment_track = "Appointment Track"; }

The confirm_deleting works fine. This function gets called in the following function

scheduler.attachEvent("onLightbox", function (event_id){ ....}

Any suggestions regarding how to fix this or even troubleshoot further?

Thank you!

confirm_closing is used in quite specific situation only - when you are editing event through inline editor, and clicking outside of event box. The message will not appear when you are clicking on cancel button it the lightbox.

Hi,

Thank you for that information. Do you know if there is anyway to have the Cancel button in the Lightbox show a confirmation before closing?

Thanks!

You can use code like next

scheduler.cancel_lightbox_origin = scheduler.cancel_lightbox; scheduler.cancel_lightbox = function(){ webix.confirm("Are you sure", function(result){ if (result) scheduler.cancel_lightbox_origin(); }); }

Also, there is onEventCancel event handler, but it not so good for async. confirmations.

Thank you!

Where should I put this chunk of code to have it execute? I put it in a few different places and nothing happened when I clicked the Cancel button.

Thanks again!

Hi,

just put this code in the method of scheduler initialization, before or after “scheduler.init()”.

scheduler.cancel_lightbox_origin = scheduler.cancel_lightbox; scheduler.cancel_lightbox = function(){ dhtmlx.confirm("Are you sure?", function(result){ if (result) scheduler.cancel_lightbox_origin(); }); }

Worked great! Thanks!