django-formset icon indicating copy to clipboard operation
django-formset copied to clipboard

Event listener for add sibling button

Open amikphoto opened this issue 1 year ago • 4 comments

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?

amikphoto avatar Apr 16 '24 14:04 amikphoto

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.

jrief avatar Apr 16 '24 14:04 jrief

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

amikphoto avatar Apr 16 '24 14:04 amikphoto

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 avatar Apr 16 '24 15:04 amikphoto

Did you have a chanse to look at HTMX ?

amikphoto avatar Apr 17 '24 15:04 amikphoto