0

Angular 8 +primeng 8

We have used Primeng package Issue : When we try to open confirm dialog of Primeng from p-dialog then its not opening. But when we try to open confirm dialog directly from page itself then it opens correctly.

Even we tried to add appendTo="body" attribute on p-dialog and p-confirmDialog

refer below code

<p-confirmDialog key="deletealerts" header="Confirmation" icon="pi pi-exclamation-triangle"></p-confirmDialog>

Thank you

Jasper de Vries
  • 19,370
  • 6
  • 64
  • 102
Monika Kumbhar
  • 45
  • 2
  • 12

4 Answers4

0

Try adding appendTo="body" only to p-confirmDialog.

0

adding appendTo="body" only to p-confirmDialog not worked though.. is having issue for opening another

So what we did achieved for this is we opened another on top of existing and given confirmation message like view with yes/no buttons.

Monika Kumbhar
  • 45
  • 2
  • 12
  • how you achieved that? I am facing same issue as my p-confirmDialog is hiding when I have p-dialog opened – Bravo May 21 '20 at 03:39
  • We used two p-dialog's. one opening on another. We avoided using p-confirmDialog as appendTo="body" not worked in our case. – Monika Kumbhar May 21 '20 at 09:35
0

You have key="deletealerts" set. If your template does not specify that key, dialog will not appear, because it will not see corresponding template. You can either add that key to template or remove it from p-confirmDialog.

0

Kind of late but if you need a clean solution for this you can try placing your p-confirmDialog inside of your p-dialog Something like this:

<p-dialog header="Test Header" [(visible)]="yourDialog" [modal]="true" [maximizable]="true" [baseZIndex]="10000"
      [draggable]="false" [resizable]="false">
      <ng-template pTemplate="content">
        <p-confirmDialog header="Delete" icon="pi pi-exclamation-triangle"></p-confirmDialog>
    
      </ng-template>
      <ng-template pTemplate="footer">
    
      </ng-template>
</p-dialog>

That solved my issue.