How to call click event in Typecript appended html button?

Hi,
I've a button which is created in appended html in typescript.I added a click function which name is btnCancelNewClientAppointment but it doesn't call it's function. How can i do that?

 let dialogObj: Dialog = (document.querySelector('.e-schedule-dialog') as EJ2Instance).ej2_instances[0] as Dialog;

  dialogObj.footerTemplate ='<div>' +  
  '<button id="saveButton" #saveSavedClientButton class="e-control e-btn e-primary sendButton" data-ripple="true">Kaydet</button>' +
  '<button id="cancelButton" #btnCancelNewClientAppointment class="e-control e-btn" data-ripple="true" (click)="btnCancelNewClientAppointment()">İptal</button>'+  
  '</div>' 


 btnCancelNewClientAppointment():void{
    let dialogObj: Dialog = (document.querySelector('.e-schedule-dialog') as EJ2Instance).ej2_instances[0] as Dialog;
    dialogObj.hide();
  }




1 Reply

BS Balasubramanian Sattanathan Syncfusion Team February 17, 2020 06:35 AM UTC

Hi Tumer, 
 
Greetings from Syncfusion Support. 
 
We have analyzed your requirement and prepared sample based on that by making use of quickInfoTemplatesFooter property like the below code. Please refer to the below UG for more details. 
 
app.component.html : 
<button title="Extra Details" (click)="onDetailsClick($event)">More Details</button> 
 
app.component.ts : 
public onDetailsClick(): void { 
    this.onCloseClick(); 
    const data: Object = this.scheduleObj.getCellDetails( 
      this.scheduleObj.getSelectedElements() 
    ) as Object; 
    this.scheduleObj.openEditor(data, "Add"); 
} 
 
 
Kindly try the above sample and let us know if you have concerns. 
 
Regards, 
Balasubramanian S 


Loader.
Up arrow icon