|
import { Component, ViewChild } from '@angular/core';
import { ScheduleComponent, EventSettingsModel, ActionEventArgs, WeekService, WorkWeekService } from '@syncfusion/ej2-ng-schedule';
import { scheduleData } from './datasource';
@Component({
selector: 'app-container',
providers: [WeekService, WorkWeekService],
// specifies the template string for the Schedule component
template: `<ejs-schedule #scheduleObj width='100%' height='550px' [selectedDate]="selectedDate" [eventSettings]="eventSettings" (actionBegin)="onActionBegin($event)" >
<e-views> <e-view option="Week"></e-view> <e-view option="WorkWeek"></e-view> </e-views> </ejs-schedule>`
})
export class AppComponent {
@ViewChild('scheduleObj')
public scheduleObj: ScheduleComponent;
public selectedDate: Date = new Date(2018, 1, 15);
public eventSettings: EventSettingsModel = { dataSource: scheduleData };
onActionBegin(args: ActionEventArgs): void {
if (args.requestType === 'eventChange') { //while editing the existing event
console.log("event edit");
}
if (args.requestType === 'eventCreate') { //while creating new event
console.log("event create");
}
}
} |
Hi Velmurgan, i have a problema similar this, i have the next interface, but when i try to edit any field, i cant bind well with the code, the 'ChangedRecords' has the object modificated but only changes of 'known properties'. following error is what i get trying binding in 'eventsettings'.
Hi Ramiro,
Greetings from Syncfusion support.
We have checked on your shared code snippet and let you know that eventSettings fields property only for the built-in fields. If you are using a custom field field with the Schedule hence it is not required to add with the eventSettings fields property. The custom fields value will be added automatically to the appointment when you add additional fields in the editor window or in the editorTemplate.
Kindly let us know if you need any further assistance on this.
Demo:
https://ej2.syncfusion.com/angular/demos/#/bootstrap5/schedule/editor-custom-field
https://ej2.syncfusion.com/angular/demos/#/bootstrap5/schedule/editor-template
UG:
Regards,
Ruksar Moosa Sait