Hi,
I’m trying to implement readonly behaviour on timeline section.
To do this i do a control on the onBeforeLightbox event.
I grab the event with the id.
Then from the event i grab the section
I control if the field codCom in my section is GRPDEF.
If it is i delete the event newly created and return false in order to not open the lightbox.
scheduler.attachEvent("onBeforeLightbox", function (id) {
var ev = scheduler.getEvent(id);
// Blocage de l'ouverture de la lightbox si la section est GRPDEF
var sectionControl = scheduler.getSection(ev.section_id);
if (sectionControl.codCom === 'GRPDEF') {
ignoreDelete = true;
scheduler.deleteEvent(ev.id);
return false;
} else{
return true;
}
});
This is working fine but it is returning an error in dhtmlxscheduler_readonly.js. (i’m using it for specific event control)
It seems that after the end of the onBeforeLightbox event he kept going throught others events.
If i follow the stack:
Uncaught TypeError: Cannot read property 'readonly' of undefined
(anonymous function)
obj.eventCatcher.z
obj.callEvent
scheduler.showLightbox
scheduler._on_mouse_up
scheduler.addEventNow
(anonymous function)
obj.eventCatcher.z
obj.callEvent
scheduler.dblclick_dhx_matrix_cell
scheduler._on_dbl_click
Is there a way to stop the propagation right after the onBeforeLightbox event?
because it is searching for an event that i just deleted
thanks