I am trying to change the renderAppointment property of the scheduler once the user clicks a button because I want to change how the appointments are displaying when the user clicks a button.
but when I try to change the render appointment of the scheduler, I have to pass the data object, but I am not sure where to get that data from. I tried doing this:
buttonClick() {
this.myScheduler.getDataAppointments().forEach(data => {
this.myScheduler.renderAppointment(this.renderAppointmentBrief(data));
});
}
// an alternative render appointment method to render the appointment description instead of the subject
renderAppointmentBrief = (data) => {
// data Object properties
// appointment - Object with the properties from the Scheduler.s source object.
// width - int
// height- int
// textColor - hex
// background - hex
// borderColor - hex
// style - string
// cssClass - string
// html - html string
// view - string
let img = '<img style="top: 2px; position: relative;" src="https://www.jqwidgets.com/angular/images/person.png"/>';
data.html = img + '<i>' + data.appointment.description + '</i>';
data.style = '#AA4643';
return data;
};
But I am getting an error. I have modified an example to demonstrate this issue and you can look at it here:
https://stackblitz.com/edit/github-ydmj79?file=src%2Fapp%2Fapp.component.ts
in this example when you click on the Test button the appointments should display the description in place of the subject of each appointment but it throws me an error because I do not have the correct data object to pass.