Hello,
I need some help to add exception to event onLimitViolation please.
I do some tests in the onlimitViolation and in a specific case, I have to launch a confirm popup (dhtmlx.confirm), but when it returns true it doesn’t work, it doesn’t launch lightbox.
I think the return true works, at this moment only, for the confirm.
Here is my code :
scheduler.attachEvent("onLimitViolation", function (ev_id, event){
var is_new = true;
var reservby_sid = event.reservsid;
ev_format = scheduler.date.date_to_str("%Y%m%d%H%i");
var start = ev_format(scheduler.getEvent(ev_id).start_date);
var now = moment().format("YYYYMMDDHHmm");
if(ev_id.toString().substring(0,3)=='RES'){
is_new = false;
} else {
is_new = true;
}
if(is_new){
if(start>now){
dhtmlx.confirm({
id: "confwind",
type: "confirm",
width: "600px",
ok: "Oui",
cancel: "Non",
text: "confirm text",
callback: function (result) {
return result;
}
});
} else {
dhtmlx.message.hide("limit_mgs");
dhtmlx.message({
id:"limit_mgs",
text:"limit message 1",
expire:4000,
type:"msgerr"
});
}
} else {
... launch a function
} else {
dhtmlx.message.hide("limit_mgs2");
dhtmlx.message({
id:"limit_mgs2",
text:"limit message2",
expire:3000,
type:"msgerr"
});
}
}
return false;
});
Thanks for your help
Loïc