From 5bd110fbfcc046dd2adf33165294e9c792ef1ebe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABl=20Kervella?= Date: Fri, 6 Oct 2017 11:32:49 +0000 Subject: [PATCH] Notifie l'objet quand on change manuellement sa valeur --- machines/templatetags/bootstrap_form_typeahead.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/machines/templatetags/bootstrap_form_typeahead.py b/machines/templatetags/bootstrap_form_typeahead.py index 32eb3818..e4d8ace7 100644 --- a/machines/templatetags/bootstrap_form_typeahead.py +++ b/machines/templatetags/bootstrap_form_typeahead.py @@ -182,6 +182,7 @@ def typeahead_datasets( f_name ) : def typeahead_updater( f_name ): return 'function(evt, item) { ' \ '$("#'+hidden_id(f_name)+'").val( item.key ); ' \ + '$("#'+hidden_id(f_name)+'").change();' \ 'return item; ' \ '}' @@ -189,5 +190,6 @@ def typeahead_change( f_name ): return 'function(evt) { ' \ 'if (evt.currentTarget.value === "") {' \ '$("#'+hidden_id(f_name)+'").val(""); ' \ + '$("#'+hidden_id(f_name)+'").change();' \ '}' \ '}'