jQuery UI Widgets Forums Scheduler Can anyone provide insights on: Scheduler?

This topic contains 1 reply, has 2 voices, and was last updated by  admin 2 months, 2 weeks ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • Can anyone provide insights on: Scheduler? #136276

    vitorio
    Participant

    How do I sync changes from the jqxScheduler back to my backend API in Angular when appointments are created or updated?


    admin
    Keymaster

    Hi,

    jqxScheduler in Angular can sync with your backend API by listening to its events appointmentAdd, appointmentChange, appointmentDelete and then sending the updated data back to your server.

      // Appointment added
      onAppointmentAdd(event: any): void {
        const appointment = event.args.appointment;
        fetch('https://your-api.com/appointments', {
          method: 'POST',
          headers: { 'Content-Type': 'application/json' },
          body: JSON.stringify(appointment)
        });
      }
    
      // Appointment updated
      onAppointmentChange(event: any): void {
        const appointment = event.args.appointment;
        fetch(<code>https://your-api.com/appointments/${appointment.id}</code>, {
          method: 'PUT',
          headers: { 'Content-Type': 'application/json' },
          body: JSON.stringify(appointment)
        });
      }
    
      // Appointment deleted
      onAppointmentDelete(event: any): void {
        const appointment = event.args.appointment;
        fetch(<code>https://your-api.com/appointments/${appointment.id}</code>, {
          method: 'DELETE'
        });
      }

    Best regards,
    Peter Stoev

    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.