0

I am using the Syncfusion Angular schedule. Add template for header quick info.

header template

            <ng-template #quickInfoTemplatesHeader let-data>
                <div *ngIf="data.elementType == 'event'">
                    <div class="e-popup-header" style="background-color: rgb(234, 122, 87);">
                        <div class="e-header-icon-wrapper">
                            <button (click)="onEditClick($event)" class="e-edit e-icons e-control e-btn e-lib e-flat e-round e-small e-icon-btn" title="Edit">
                                <span class="e-btn-icon e-icons e-edit-icon"></span>
                            </button>
                            <button (click)="onDeleteClick($event)" class="e-delete e-icons e-control e-btn e-lib e-flat e-round e-small e-icon-btn" title="Delete">
                                <span class="e-btn-icon e-icons e-delete-icon"></span>
                            </button>
                            <button (click)="onCloseClick($event)" class="e-close e-control e-btn e-lib e-flat e-round e-small e-icon-btn" title="Close">
                                <span class="e-btn-icon e-icons e-close-icon"></span>
                            </button>
                        </div>
                        <div class="e-subject-wrap">
                            <div class="e-subject e-text-ellipsis" [title]="data.Subject"><div [innerHTML]="data.Subject"></div></div>
                        </div>
                    </div>
                </div>
            </ng-template>

When I click edit button or double click on tab erase an js error: Cannot read property '0' of undefined

js error

This my ts event to click editor:

public onEditClick(args: any): void {    
    if (this.selectionTarget) {
      let eventData: { [key: string]: Object } = this.scheduleObj.getEventDetails(this.selectionTarget) as { [key: string]: Object };
      let currentAction: CurrentAction = 'Save';
      
      // console.log("TEST", eventData);

      this.scheduleObj.openEditor(eventData, currentAction);
    }
  }

I follow the official guide:

https://ej2.syncfusion.com/angular/documentation/schedule/editor-template/

L.Zoffoli
  • 129
  • 3
  • 10

1 Answers1

0

Kindly include the button component ejs-button in the ng-template to resolve this problem like below

    <ng-template #quickInfoTemplatesHeader let-data>
    <div *ngIf="data.elementType == 'event'">
        <div class="e-popup-header" style="background-color: rgb(234, 122, 87);">
            <div class="e-header-icon-wrapper">
                <button (click)="onEditClick($event)" ejs-button class="e-edit e-icons e-control e-btn e-lib e-flat e-round e-small e-icon-btn" title="Edit">
          <span class="e-btn-icon e-icons e-edit-icon"></span>
      </button>
                <button (click)="onDeleteClick($event)" ejs-button class="e-delete e-icons e-control e-btn e-lib e-flat e-round e-small e-icon-btn" title="Delete">
          <span class="e-btn-icon e-icons e-delete-icon"></span>
      </button>
                <button (click)="onCloseClick($event)" ejs-button class="e-close e-control e-btn e-lib e-flat e-round e-small e-icon-btn" title="Close">
        <span class="e-btn-icon e-icons e-close-icon"></span>
       </button>
            </div>
            <div class="e-subject-wrap">
                <div class="e-subject e-text-ellipsis" [title]="data.Subject">
                    <div [innerHTML]="data.Subject"></div>
                </div>
            </div>
        </div>
    </div>
</ng-template>

For more reference, please refer to the below sample.

https://stackblitz.com/edit/angular-eetjnm?file=app.component.html

Vengatesh
  • 49
  • 3