简体   繁体   English

当 p-dialog 已经在 angular 5 的视图中时,primeng p-confirmDialog 不显示

[英]primeng p-confirmDialog is not displaying when p-dialog is already in the view in angular 5

I am having trouble to use the p-confirmDialog on the top of the p-dialog in angular.我无法使用 angular 中 p-dialog 顶部的 p-confirmDialog。

I have tried appendTo="body" but it is not working for me.我试过appendTo="body"但它不适合我。

Is there anyway we can get the p-confirmDialog on top of the p-dialog?无论如何,我们可以在 p-dialog 之上获得 p-confirmDialog 吗?

I have checked in html using inspect element but I am not able to see the p-confirmDialog at all.我已经使用检查元素检查了 html,但我根本看不到 p-confirmDialog。

I don't know what I am doing wrong.我不知道我做错了什么。

Child Component:子组件:

import {ConfirmationService} from 'primeng/components/common/confirmationservice';

constructor(protected confirmBox: ConfirmationService) {}

opendialog() {
  let message = "Are you sure you want to active this template?"

  this.confirmBox.confirm({
    message: "Are you sure you want to active this template?",
    header: "Confirmation",
    icon: "fa fa-question-circle",
    accept: () => {
      //logic
    },
    reject: () => {
      console.log('Ok');
    }
  });
}

Parent Component:父组件:

<p-dialog [closable]="true" header="Confgiure " [(visible)]="displayConfiguration" [contentStyle]="{'overflow':'visible'}" [width]="1650" modal="modal" [responsive]="true">

  <app-configure-template [typeSelected]="typeSelected" *ngIf="displayConfiguration"></app-configure-template>

</p-dialog>

<p-confirmDialog appendTo="body"></p-confirmDialog>

Child Component: app-configure-template:子组件:应用程序配置模板:

<div>
  <button class="" pButton (click)="opendialog()" label="Confirm"></button>
</div>

<p-confirmDialog appendTo="body"></p-confirmDialog>

Have you tried baseZIndex?你试过baseZIndex吗?

 [baseZIndex]="1000"

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM