jrief / django-formset

The missing widgets and form manipulation library for Django
https://django-formset.fly.dev/
MIT License
317 stars 30 forks source link

Event listener for add sibling button #134

Open amikphoto opened 4 months ago

amikphoto commented 4 months ago

I use HTMX in formset form with siblings. When I press add sibling button formset adds sibling but HTMX doesn't know about DOM changes. There's a procedure in HTMX which could add new content to HTMX DOM but I have to start this procedure after formset siblings was added. Could you help me with any idea how to do it? It would be great to have an event listener in formset to start adding sibling and end adding sibling. Or maybe you have another way?

jrief commented 4 months ago

Can you please point me on the specific page of the HTMX documentation.

Btw. I would really appreciate, if you could add an example using HTMX to the testapp/-folder. This would help me in adding the necessary hooks so that these two libraries can work together.

amikphoto commented 4 months ago

https://htmx.org/api/#process

amikphoto commented 4 months ago

You can see htmx samples on HTMX site. https://htmx.org/examples/ It works fine with your formset java but now I have a problem with new sibling.

amikphoto commented 4 months ago

Did you have a chanse to look at HTMX ?