I try too implement a lightbox for one kind of event.
I have actually more or less displayed the information in the lightbox form.
When I click save, I have an event onEventSave where I don’t do anything (just a display of information fro the moment)
What puzzle me is that the event is losing its internal text after clicking Save.
As I don’t change anything in my date, what could make this change ???
I have tried also now to modify event.text and event.details to change the text according to what is in the lightbox, but it doesn’t seem to do anything.Could you help me ?
My lightbox section uses 4 sections, 2 are actually not used and the 2 others display information about the event. I don’t change anything in the form, I just click Save.
If I click cancel, there is no change. I have no code in the getvalue for each sections.
a) onEventSave is blockable, be sure to end custom handler with return true - or it will block default behavior.
b) its may be not the best moment to alter values, because they not fully saved yet. Try to use onEventAdded, onEventChanged instead.
I have seen that at first I load my event with a text property (I thought that it was one of the base property of an event, where it is start_date end_date and details in fact)
The event content is a picture and the event.text property that I apply in the scheduler.templates.event_text template.
I have seen by adding a string giving the current date and time that the event is updated in this function after saving in the lightbox. it seems to me that the propety text is lost when updating from the lightbox but I don’t understand why. Does all customized properties are lost ???
When updating from lightbox , scheduler will do the next for each form section
- call get_value method of section
- set property, specified in map_to, with result of get_value
if your get_value returns empty text the mapped field will be erased.
I didn’t understand the map_to property, as I put “text” as in the example (I was thinking that text refer to the data type…). By following the code in the debugger i saw that it was due to the map_to property.
In fact I didn’t need the map_to propety in my case ^^;
Thank you !