The advantage is that the layout is now modified by crispy_forms applying the selected template pack (e.g. bootstrap4). Only the CSS .delete-row must be secified to center the remove button of the django-formset plugin because only a link is added if the containing element is not a HTML-table.
Hey Xenia,
thank you for this helpful post. That's exactly what I was looking for. I've applied a small modification to make your solution a bit more
crispy
;-)Instead of putting all the form layout stuff into the file
formset.html
it would a better solution to add aLayoutHelper
to theCollectionTitleForm
:forms.py
Then you can simplify your
formset.html
The advantage is that the layout is now modified by
crispy_forms
applying the selected template pack (e.g. bootstrap4). Only the CSS.delete-row
must be secified to center the remove button of thedjango-formset
plugin because only a link is added if the containing element is not a HTML-table.Best regards,
andi
Thanks for your contribution! I merged it into a new branch :)
thank you all for the whole code. but my "remove" item is not working :( I tried all solutions with no result :'(