From 8a85125fee259fe76bc45be2fbd20609782149bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Delobelle?= Date: Wed, 17 Aug 2016 11:56:42 +0200 Subject: [PATCH] =?UTF-8?q?K-Psul:=20resetBasket=20r=C3=A9initialise=20le?= =?UTF-8?q?=20formset?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- kfet/templates/kfet/kpsul.html | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/kfet/templates/kfet/kpsul.html b/kfet/templates/kfet/kpsul.html index e311318a..ef903390 100644 --- a/kfet/templates/kfet/kpsul.html +++ b/kfet/templates/kfet/kpsul.html @@ -529,6 +529,9 @@ $(document).ready(function() { function resetBasket() { basket_container.find('tr').remove(); + mngmt_total_forms = 1; + mngmt_total_forms_input.val(1); + formset_container.find('div').remove(); } // ----- @@ -630,6 +633,8 @@ $(document).ready(function() { var index = mngmt_total_forms; console.log(operation_html); + operation_html.attr('data-opeindex', index); + operation_html .find('#id_form-__prefix__-type').val(type).end() .find('#id_form-__prefix__-amount').val(amount).end()