changes the event's id
id | string | the current event's id |
new_id | string | the new event's id |
scheduler.changeEventId("ev15", "ev25"); // changes the event's id "ev15" -> "ev25"
Each event displayed in the scheduler has a unique id value.
When a new event is created from the UI it gets a temporary id generated by the Scheduler library.
After an event is inserted into the database it obtains a permanent id generated by the database. The regular flow is that your backend handler returns the database id back to the client side where scheduler picks it up and uses for future updates of the event.
If you use the dataProcessor module and follow server-side integration tutorials, it should happen automatically. However, if you send updates to the backend manually, you'll have to apply the database id manually using this method. For example:
// create a new event
jQuery.ajax({
type:"POST",
url:"/myApi/event",
data:{ data : event },
complete:function(result){
// backend response after inserting a new event into the db
scheduler.changeEventId(event.id, result.databaseId);
}
});
Note, the method fires the onEventIdChange event.