We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Editor Template. Customize title?

Hi,

I would really love an option to provide my own template, including form, title and buttons(submit/cancel). Currently the code to do any custimization seems to be very messy, and I would love the option to manage my own form in the future.

Currently I'm trying to change the title, and the buttons. Is there any way to do this?

3 Replies

KK Karthigeyan Krishnamurthi Syncfusion Team December 10, 2018 07:45 AM UTC

 
Thank you for contacting Syncfusion support. 
 
Kindly use the below code example to customize the local words and for the same we have prepared the below sample. 
 
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 { 
  } 
} 
 
 
Regards, 
Karthigeyan 
 



CC Carla Candiotti June 19, 2023 12:27 PM UTC

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?



RV Ravikumar Venkatesan Syncfusion Team June 20, 2023 03:44 PM UTC

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.


Sample: https://stackblitz.com/edit/ej2-angular-schedule-openeditor-method-sample?file=src%2Fapp.component.ts

UG: https://ej2.syncfusion.com/angular/documentation/schedule/how-to/open-event-editor-manually#open-editor-window-externally


[app.component.ts]

  public addClick(args): void {

    var data = { subject: 'Clone'startTime: new Date(20235208), endTime: new Date(202352012) };

    this.scheduleObj.openEditor(data'Add');

  }


Regards,

Ravikumar Venkatesan


Loader.
Live Chat Icon For mobile
Up arrow icon