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

how i can show confirmation when click close button edit dialog

how i can show confirmation when click close button edit dialog

1 Reply

RS Rajapandiyan Settu Syncfusion Team December 14, 2022 10:07 AM UTC

Hi Apisit,

Thanks for contacting Syncfusion support.

In EJ2 Grid, the confirmation popup is not shown when clicking the cancel button in the Edit Dialog. You can achieve your requirement by manually showing the custom confirmation popup.

In the actionBegin event (requestType as cancel), we prevented the default action of cancel and showed the custom confirmation popup based on the flag variable.

actionBegin: https://ej2.syncfusion.com/angular/documentation/api/grid/#actionbegin

actionComplete: https://ej2.syncfusion.com/angular/documentation/api/grid/#actioncomplete



// custom confirm dialog














export class AppComponent {



  public confirmDialog: DialogComponent;


  // Close the Edit Dialog, while clicking "OK" Button

  public dlgOKClick = (): void => {


    this.flag = false;



  // maintain the Edit Dialog

  public dlgNOClick = (): void => {

    this.flag = true;



  public buttons: { [key: string]: ButtonModel }[] = [


      click: this.dlgOKClick.bind(this),

      buttonModel: { content: 'OK', isPrimary: true },



      click: this.dlgNOClick.bind(this),

      buttonModel: { content: 'Cancel' },



  actionBegin(args) {

    if (args.requestType == 'cancel' && this.flag) {

      args.cancel = true; // prevent the default cancel action

      this.confirmDialog.show(); // show the custom confirm dialog




  actionComplete(args) {

    if (args.requestType == 'cancel') {

      this.flag = true; // make the flag variable true





Sample: https://stackblitz.com/edit/angular-mpd7dt-aqjf65?file=app.component.html,app.component.ts


Rajapandiyan S

Live Chat Icon For mobile
Up arrow icon