elo80ka / django-dynamic-formset

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

Unsetting and resetting the current formset #198

Open wilberninsiima opened 2 years ago

wilberninsiima commented 2 years ago

I like the concept of dynamic formsets plugin, I have been using it perfectly but here is a challenge My formset items are dynamic based on the user's choice. Qty and UnitPrice are set visible by the user (JS), But whenever the user clicks the ADD Line, the default arrangement is appended, Say when previously the qty is checked, still a new dynamic formset comes without the qty field. Image below

image

Is there any way to reset or destroy the formset on an element such that it recognises the new arrangement based on the user's choice? Because when I call it multiple times, the more formset items are appended