0

I use https://github.com/elo80ka/django-dynamic-formset to add and delete rows from a formset.

The problem is that the add row and delete row buttons are automatically inserted weird places.

Can I place these buttons manually?

Or are there any other jquery libraries to add and delete rows in a formset dynamically?

1 Answer 1

2

I don't think you can place these buttons manually, maybe if you check the rules followed by the plugin to place the buttons: https://github.com/elo80ka/django-dynamic-formset/blob/master/src/jquery.formset.js#L49

As you can see:

//If the forms are laid out in table rows, insert // the remove button into the last table cell

// If they're laid out as an ordered/unordered list, // insert an < li > after the last list item

// Otherwise, just insert the remove button as the // last child element of the form's container

You can specify addCssClass (which is by default 'add-row'), maybe that can help you.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.