elo80ka / django-dynamic-formset

A jQuery plugin that allows you dynamically add new forms to a rendered django formset.
677 stars 311 forks source link

Only add remove links for current working form #106

Open JoeStaines opened 8 years ago

JoeStaines commented 8 years ago

When using multiple formsets, adding a new form would create remove links for every other form on the page. This was because it was searching for all elements with 'a.delete-row' (or whatever you chose as the deleteCssClass) and showing all of them, which could span across multiple formsets.

This patch just uses the formCssClass attribute to determine the formset we are working on and only shows the remove links for those elements.