jQWidgets Forums

jQuery UI Widgets Forums Angular Cannot change the RenderAppointment property of the scheduler at runtime

This topic contains 1 reply, has 2 voices, and was last updated by  Hristo 4 years, 8 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author

  • Asg
    Participant

    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.


    Hristo
    Participant

    Hello Asg,

    You could try this approach below:
    https://stackblitz.com/edit/github-ydmj79-biggw6?file=src/app/app.component.ts

    Best Regards,
    Hristo Hristov

    jQWidgets team
    https://www.jqwidgets.com

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.