Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option to not automatically add Add/Delete links to formsets #6

Open
elo80ka opened this issue Feb 27, 2014 · 2 comments
Open

Add option to not automatically add Add/Delete links to formsets #6

elo80ka opened this issue Feb 27, 2014 · 2 comments

Comments

@elo80ka
Copy link
Owner

elo80ka commented Feb 27, 2014

From benn...@gmail.com on February 20, 2010 19:55:37

My template include some more complex add/delete formset links already
inside formset so there is no need to add them to the end. A simple CSS
class added to the anchor tag is not enough for my use.

The attached patch adds an option called autoAddLinks that you can set to
false to prevent any links being added.

Attachment: jquery.formset-add_option_to_not_auto_add_adddel_links.patch

Original issue: http://code.google.com/p/django-dynamic-formset/issues/detail?id=6

@elo80ka
Copy link
Owner Author

elo80ka commented Feb 27, 2014

From stan.madueke on February 21, 2010 02:26:25

Thanks for the patch benneth. If you don't mind my asking, how do your add/remove links
work currently? How did you wire them up to the appropriate methods that add and remove
a form instance? Also, do you perform any additional tasks in the click event handlers?

@elo80ka
Copy link
Owner Author

elo80ka commented Feb 27, 2014

From benn...@gmail.com on February 21, 2010 08:58:53

Well 'Add' is always there not matter what and your script already automatically
hides the 'Delete' with the correct class on it so that is taking care of.

So the add and delete links are just inside my formset. They are cloned with the
rest of the formset.

My issue was that I need to wrap a div around the anchor tag to do some more advanced
formatting that couldn't be solved with css.

I do do some additional tasks on add using the 'added' callback, but not on the click
handler.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant