I need to re-write the event_header of the new event. This is what I have done, but I’ve noticed that scheduler.templates.event_header = function()… loops through all the events. Is this the best way to update the event_header of a single item?
scheduler.attachEvent("onEventCreated",function(id,ev){
//this will fire on any changes to the event box ie. enlarging time slot
console.log(id);
scheduler.templates.event_header = function(start,end,ev){
//this will loop through all the events
if(ev.id == id){
return '<i class="fa fa-bell reminder" style="color: red;"></i> <?php echo __('reminder'); ?>: '
+ scheduler.templates.event_date(start) + " - "
+ scheduler.templates.event_date(end);
}else{
return scheduler.templates.event_date(start) + " - "
+ scheduler.templates.event_date(end);
}
};
});