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

Allow removal of forms in a formset that are not "extra" #106

Open
coreylight opened this issue Aug 6, 2015 · 2 comments
Open

Allow removal of forms in a formset that are not "extra" #106

coreylight opened this issue Aug 6, 2015 · 2 comments

Comments

@coreylight
Copy link

Getting an error of
Can't remove a form when there are no extra forms
when I try to remove a form in a formset that is populated with initial data.
What is the reason for disallowing removal of those forms?

@adamziel
Copy link

adamziel commented Oct 7, 2015

+1

@hestacio
Copy link

hestacio commented Jun 8, 2017

I don't know if you guys still care, I had the same problem so I just hijacked the removeForm method in FormSet.js in the node module

my formSet is called airlineFormSet

deleteItemAirline(index) {
this.state.airlineFormSet.extra--;
if (this.state.airlineFormSet._forms !== null) {
this.state.airlineFormSet._forms.splice(index, 1)
}
if (this.state.airlineFormSet._errors !== null) {
this.state.airlineFormSet._errors.splice(index, 1)
}
this.state.airlineFormSet._stateChanged();
}

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

No branches or pull requests

3 participants