I have a lightbox with custom select and radio elements.
Apparently it all works fine, whatever I have in the grid appears correctly on lightbox open, and any changes in the lightbox get updated in the grid.
But now I need to catch the onLightboxSave event to perform validations, and the custom fields aren’t there.
An example:
gantt.attachEvent(“onLightboxSave”, function(id){
var task = gantt.getTask(id);
if (!task.worker) { // --> task object doesn’t have a worker key
alert(“The worker field is mandatory. Please try again”);
return false;
}
Hello,
Could you clarify if you use the default lightbox with custom elements or you have a custom lightbox with custom elements? onLightboxSave fires only for the default Lightbox when you click on the “Save” button.
Maybe when you check if the option is selected, there is task.worker property but it is "" or something else that makes Javascript think that it is valid.
You can try editing the snippets above and reproduce the issue there. And I will see what might be wrong.