themesberg / volt-bootstrap-5-dashboard

Free and open source Bootstrap 5 Admin Dashboard Template with vanilla Javascript
https://themesberg.com/docs/volt-bootstrap-5-dashboard/getting-started/quick-start/
MIT License
2.62k stars 303 forks source link

Show Modal using js function #57

Closed Usouf closed 3 years ago

Usouf commented 3 years ago

I have a use case where I would like to pass some data to the modal and open it using js function. How can I achieve that in Volt?

Usouf commented 3 years ago

Never mind! Found the solutionl

vinit-m commented 3 years ago

Can you please drop the solution? I am facing the same issue. I want to open bootstrap modal using js.

vinit-m commented 3 years ago

Never mind this works for me

import * as boostrap from 'vendor/bootstrap/js/bootstrap.min.js'; (function () { const modal = document.getElementById('modalFileUpload'); const myModal = new bootstrap.Modal(modal) myModal.show() })();

ghost commented 3 years ago

Oh sorry I don't use that kind of style

On Tue, 12 Oct 2021, 08:58 vinit-m, @.***> wrote:

Never mind this works for me import * as boostrap from '{% static 'vendor/bootstrap/js/bootstrap.min.js' %}'; (function () { const modal = document.getElementById('modalFileUpload'); const myModal = new bootstrap.Modal(modal) myModal.show() })();

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/themesberg/volt-bootstrap-5-dashboard/issues/57#issuecomment-940720776, or unsubscribe https://github.com/notifications/unsubscribe-auth/AWATY6KDGLJNWEFYZMF36NTUGPMCDANCNFSM5E5KGLKQ .