Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Tim Sanders on Jul 14, 2009 16:47
open dhtmlx forum
Validate Event Change in Scheduler

I am trying to use the onEventChanged event to validate changes to an event. If there is a validation error I want to fail on the change (restore to original values). Can I do this?

Thanks.
Answer posted by Support on Jul 15, 2009 05:19
Event occurs after moment, when changes already made, so it is too late to prevent modification. 
There are two possible solution
a)
   - wrap showLightbox method of scheduler with custom code , and save properties of event before opening lightbox from
   - in onEventChanged handler , restore properties to saved ones, if necessary

b) replace default editors inside lightbox form with custom ones - in such case you can control get_value method of section , and return old or new value , based on validation rules.