Complex objects binded to FieldOptionsModel

Hello,


I'm working with appointments such as:

interface Slot {
startDate: Date;
endDate: Date;
}
interface Appointment {
title: string;
    slot: Slot;
}

To work with scheduler, I saw that we can bind our appointment fields to scheduler's one.


this.eventSettings.fields = {
    subject: {name: 'title' },
    startTime: {name: 'slot.startDate'},
    endTime: {name: 'slot.endDate'}
};


Subject's binding is working fine but I can't manage binding dates fields to my model, do you have any solution?


Thanks for your response


1 Reply 1 reply marked as answer

RM Ruksar Moosa Sait Syncfusion Team November 25, 2022 10:16 AM UTC

Hi Carla,


The start time and end time fields of the appointment are mandatory, and they need to be present at the root of the appointment. Add the startDate and endDate fields in the interface, like the below code, to bind the appointment fields to the scheduler.


Sample: https://stackblitz.com/edit/angular-pmxw3s?file=app.component.ts


Export interface Appointment {

  titlestring;

  startDateDate;

  endDateDate;

}



  Public eventSettingsEventSettingsModel = { dataSource: this.data,

    fields: {

    subject: {name: 'title' },   

    startTime: {name: 'startDate'},

    endTime: {name: 'endDate'}

    }

  };  


Output:


Regards,

Ruksar Moosa Sait


Marked as answer
Loader.
Up arrow icon