import { Component, OnInit, ViewEncapsulation } from '@angular/core';
import {
EventSettingsModel, DayService, WeekService, WorkWeekService, MonthService,
AgendaService, ScheduleComponent, View,ResizeService, DragAndDropService
} from '@syncfusion/ej2-angular-schedule';
import { L10n } from '@syncfusion/ej2-base';
L10n.load({
'en-US': {
'schedule': {
"newEvent": "Add Event",
"saveButton": "Ok",
"cancelButton": "No",
},
}
});
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
providers: [DayService, WeekService, WorkWeekService, MonthService, AgendaService,ResizeService, DragAndDropService],
encapsulation: ViewEncapsulation.None
})
export class AppComponent implements OnInit {
public selectedDate: Date = new Date(2018, 1, 15);
ngOnInit(): void {
}
} |
What about setting a custom translation key to the form header? I'm trying to enable event duplication though a custom form, but I can't pass data and call open editor with 'Add' option:
this.scheduleObj.openEditor({data}, 'Add');
The form opens with no data, but if I pass 'Save' action type, the header is wrong because we're not editing an appointment but creating/duplicating.
I would like to open create editor but pass data at the same time, is it possible?
Hi Carla,
Q1: What about setting a custom translation key to the form header?
We are unable to understand your requirement based on your shared details. Could you please share more details about your requirement like a use case scenario, image, video demonstration, etc?
Q2: I would like to open create editor but pass data at the same time, is it possible?
Yes. You can open the editor window to create an appointment using the openEditor method by passing data as shown in the below code snippet. Try the shared sample and refer to the UG for more details.
[app.component.ts]
public addClick(args): void { var data = { subject: 'Clone', startTime: new Date(2023, 5, 20, 8), endTime: new Date(2023, 5, 20, 12) }; this.scheduleObj.openEditor(data, 'Add'); } |
Regards,
Ravikumar Venkatesan