Closed vidalperezleida closed 2 months ago
Hello and welcome to SQLPage ! What are you building ? In what context do you need a modal ?
Hi. Just testing. But I thought in many applications you want to do some action and not reload all page. For example validate some data and show a message to the user or show some detailed info when they click on a button.
SQLPage encourages you to write your logic in SQL, and to avoid keeping state on the client. This makes everything simpler and more approachable, but it requires giving up old habits if you are used to frontend development. SQLPage makes page loads very fast, and reloading the entire page is generally several times faster than it is when using traditional frontend frameworks.
If while building your application, you encounter a situation where you need a modal, we can reopen this issue and discuss it here !
Hi. First, thanks for this amazing project. There is a way of showing a modal box currently in sqlpage, If not I think it will be a good addition.
I'm doing some testing and I manage to show a static model but maybe with some tweaks could be dynamic.
I create a template modal.handlebars in templates directory. The content comes from the tabler docs: https://tabler.io/docs/components/modals
Then I created a index.js javascript file that search for the button responsible to open the modal and add two attributes. The content:
now in the index.sql file:
When you open the index.sql you see:
Then click on the button:
Some things that might be interesting to:
Thanks