-
Notifications
You must be signed in to change notification settings - Fork 311
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
Dynamically added row cannot be saved, deleted row still be saved #161
Comments
it still happen in django 3.1 |
Hello. I have the same problem? Did you find a solution? |
I'm currently only using it for inline formsets within tables I managed to fix the deletion problem by editing the source code, updating this part of code: if (del.length) {
// We're dealing with an inline formset.
// Rather than remove this form from the DOM, we'll mark it as deleted
// and hide it, then let Django handle the deleting:
del.val('on');
row.hide();
forms = $('.' + options.formCssClass).not(':hidden');
totalForms.val(forms.length);
} To this: if (del.length) {
// We're dealing with an inline formset.
// Rather than remove this form from the DOM, we'll mark it as deleted
// and hide it, then let Django handle the deleting:
del.val('on');
row.hide();
forms = $('.' + options.formCssClass);
totalForms.val(forms.length);
} I was getting a weird behavior when deleting several items because by excluding the hidden rows (marked as deleted) from the |
Having same issue with Django 1.11 and above changes is not helping. @vitorfs |
I am using django 3.0.2.
Any idea to fix it, thanks.
The text was updated successfully, but these errors were encountered: