Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

176
Vistas
Make OnClose event run when clicking outside dialog box with dismissableMask set true

I have a dialog box that accepts user input and runs a function on closing of the dialog box. Using primeng dynamic dialog component. This function is called during the onClose event. This works fine with a close button.

I have dispossable mask on to allow user to close box by clicking outside of it. Here the onClose event doesnt fire. Is there any way to capture the event where user clicks outside the box or to make onClose fire?

https://www.primefaces.org/primeng/dynamicdialog

component 1

addQuoteDialog() {
    let selectedData = this.gridApi.getSelectedRows();

    const ref = (this.addQuoteDialogRef = this.dialogService.open(
      AddQuoteDialogComponent,
      {
        width: '95%',
        styleClass: 'user-details',
        showHeader: false,
        //contentStyle: { 'max-height': '500px', overflow: 'auto' },
        height: '70',
        data: {
          selectedData: selectedData,
        },
        dismissableMask: true,
      }
    ));
    ref.onClose.subscribe((response) => {
      ref.destroy();
    });
    return ref;
  }

component 2

  onClose() {
    console.log('onclose');
    this.quoteDisplayFalse();
    this.ref.close();
  }
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Add a console after "ref.onClose.subscribe((response) => { ". You will get the console being logged when you click outside the box. Here, you can also write another function being called upon close.

No need to do ref.destroy, as it will automatically close the dialog box.

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda