auto close popup and parent



  • I have a page that opens a popup for editing data.
    When I click save/delete it opens a popup ‘Are you sure ??’

    this.$q.dialog({
      title: 'Deleted',
      message: 'Registro excluído com sucesso',
        ok: {
          push: true,
          ClosePopup: 2 (should this work ?)
        }
      })
    

    I’d like that when I click de Ok button on the second popup, it closes it self and the parent popup.

    Wifth q-dialog I can use the directive v-close-popup=2, but with the dialog plugin I couldn’t find how to use it.

    If this is not possible, how can I close the first popup ? I can click Ok on the second popup and close the first popup by code, but how ?

    Tks



  • So you want a dialog over a dialog, and when the second/ top dialog closes, the first one closes too? Like this? https://codepen.io/smolinari/pen/VwYzZXZ?editors=1010

    With the Dialog plugin, you’d need to use the hide() method.

    Scott



  • I don’t know if that way will work in my case.
    I have a main app, the first dialog opens a component and the second dialog is just a dialog inside the component. The objects are in different scopes.
    I solved like this :

    main app opening the first dialog

        <q-dialog v-model="AtratDados" >
          <cad_atrativos :prop_linha_clicada="atrativo_clicado" :visivel="AtratDados" @evtFechaCadAtrativos="AtratDados=false" />
        </q-dialog>
    

    first dialog showing second dialog

                this.$q.dialog({
                  title: 'Registro excluído',
                  message: 'Registro excluído com sucesso',
                  ok: {
                    push: true
                  }
                }).onOk(() => {
                  this.$emit('evtFechaCadAtrativos')
                })
    

    Thanks for your help


Log in to reply