You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Great stuff on Fasthtml, I have been enjoying it a lot.
I am trying to understand how to set response header, mainly, I am trying to set Hx-Trigger. The application I have is a modal that has a form. When the form is submitted and handled successfully, I would like to do two actions:
Update UI with the newly created element.
modal.close()
The first is easy. The second one is more difficult. I did research and found that the best way is to trigger a custom event via the aforementioned hx-trigger. I searched a lot and I can't find how to set such trigger with fasthtml.
This is a video of what I am trying to achieve:
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Great stuff on Fasthtml, I have been enjoying it a lot.
I am trying to understand how to set response header, mainly, I am trying to set
Hx-Trigger
. The application I have is a modal that has a form. When the form is submitted and handled successfully, I would like to do two actions:The first is easy. The second one is more difficult. I did research and found that the best way is to trigger a custom event via the aforementioned hx-trigger. I searched a lot and I can't find how to set such trigger with fasthtml.
This is a video of what I am trying to achieve:
htmx_modals.mp4
This video is from an article on how to do this in Django:
https://github.com/spookylukey/django-htmx-patterns/blob/master/modals.rst
Beta Was this translation helpful? Give feedback.
All reactions