Utility Dialog okButton function does not receive the right parameter

i want to use data parameter in excluirContaBancaria()

Captura de Tela 2023-03-28 às 11.26.17.jpg

but that's what cb is getting:

Captura de Tela 2023-03-28 às 11.26.33.png


1 Reply

BS Buvana Sathasivam Syncfusion Team March 29, 2023 01:01 PM UTC

Hi Fernando,


Greetings from Syncfusion support.


You will be able to retrieve the data when you click the Dialog OK button, as shown in the code below.


 public onOpenDialog = function (eventany): void {

    var dataany = { id: 1intera: true };

    this.DialogObj = DialogUtility.confirm({

      title: 'Confirmation Dialog',

      content: 'This is a Confirmation Dialog!',

      okButton: { text: 'OK'click: this.okClick.bind(thisdata) },

      showCloseIcon: true,

      closeOnEscape: true,

      animationSettings: { effect: 'Zoom' },

    });

  };

  okClick(dataevent) {

    console.log(data);

    this.DialogObj.hide();

  }


Sample: https://stackblitz.com/edit/angular-lutbg6?file=src%2Fapp.component.ts,src%2Fapp.component.html


Regards,

Buvana S


Loader.
Up arrow icon