changeEventId

changes the event's id

void changeEventId(string id,string new_id);
idstringthe current event's id
new_idstringthe new event's id

Example

scheduler.changeEventId("ev15", "ev25"); // changes the event's id "ev15" -> "ev25"

Details

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.

See also
Back to top