Giter Club home page Giter Club logo

Comments (3)

DenisTsenov avatar DenisTsenov commented on May 23, 2024

Hello @Luckyfella73. I have same issue. Do you manage to solve it? I implement Laravel Vue Datatable package and one of my columns is confirm delete action/button. It seems the modal to appear as many time as records in the table. So, if i have 3 table rows and i click on some of the confirm buttons, in order to close the modal i have to click 3 time outside of it or on some button ok/close in order to close it.

from vue-confirm-dialog.

Luckyfella73 avatar Luckyfella73 commented on May 23, 2024

@DenisTsenov Unfortunately I didn't solve this issue. But if you are going to solve it I would appreciate if you post the solution here :)

from vue-confirm-dialog.

DenisTsenov avatar DenisTsenov commented on May 23, 2024

Hi @Luckyfella73. Unfortunately i was unable to solve it, but i found few 'workarounds'. The first one is to redirect on the same page right after click on some of the ok/cancel buttons of the modal, which is kind of annoying.
The other one is to move the coresponding modal in separate page(which i already have). And if you chose the second one you have to be careful where you put the button/link which invoke the modal, because if it is in a form, the modal will dissapear kind of flash within less than a second. If it is outside of a form tag the modal work fine.

First workaround:

confirmRemove() {
this.$confirm({
                title: `Remove team`,
                message: `Are you sure you want to continue ?`,
                button: {
                    no: 'Cancel',
                    yes: 'Ok'
                },
                /**
                 * Callback Function
                 * @param {Boolean} confirm
                 */
                callback: confirm => {
                    if (confirm) {
                        axios.post(this.destroyRoute)
                             .then(response => {
                               window.location = response.data.route;
                             }).catch(error => {
                          alert('Something went wrong! Please try again later');
                        });
                    }

                  window.location = you_app_url;
                }
            });
}

Second one is without window.location = you_app_url;, but ouside of a form tag and in a separate page.

from vue-confirm-dialog.

Related Issues (16)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.