Event text update not committed to database

Hi,
I am trying to find the best way to commit any changes made to the event text field.
I am doing it as follows:

function updateText(event_object,serviceName,customer) {
            if (event_object.text=="New event") 
                scheduler.setEventText(event_object.id,serviceName+": "+customer+".");
            else
                scheduler.setEventText(event_object.id,serviceName+": "+customer+". "+data.text) ;
            
            scheduler.updateEvent(event_object.id); // render updated event
         } 

I’m calling this AFTER the initial event has been committed to the database, as otherwise I don’t have a valid event_id. When I try to use the autogenerated (timestamp like) initial event_id (before commit), the setEventText function appears not to work.

With the current code the correct text value is shown on the calendar. However, the DB value is not updated, so on refresh I see the old value.

Is it possible to handle this from the JS side (without updating the text on the lightbox before saving) or do I need to take care of this separately on the server side?

thanks,
Rose

Hello,

scheduler.updateEvent(event_object.id); // render updated event

Only updates event rendering, it doesn’t trigger saving to the database.
What you were looking for is the setUpdated method of the dataproccessor.
Sample code:

scheduler.attachEvent("onEventIdChange", function(old_event_id,new_event_id){ var serviceName = "Some service"; var customer = "Andrew"; var ev = scheduler.getEvent(new_event_id); ev.text = serviceName+": "+customer+". "+ev.text; scheduler.updateEvent(new_event_id); dp.setUpdated(new_event_id, true, "updated"); });
Hope this helps.

Best regards,
Ilya