From 0811875f75ddf84a1b08f6f9986602ad92806ec4 Mon Sep 17 00:00:00 2001 From: Sanj Date: Thu, 19 Jul 2012 23:52:14 +0530 Subject: [PATCH] for some reason, empty values were getting rendered as [] in autocomplete val, fixed --- itf/templates/formwidgets/select2.html | 2 +- itf/templates/test/person_form.html | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/itf/templates/formwidgets/select2.html b/itf/templates/formwidgets/select2.html index aa0ca2d..6166b9a 100644 --- a/itf/templates/formwidgets/select2.html +++ b/itf/templates/formwidgets/select2.html @@ -1,2 +1,2 @@ - + + + diff --git a/itf/templates/test/person_form.html b/itf/templates/test/person_form.html index 87a4a86..241ff10 100644 --- a/itf/templates/test/person_form.html +++ b/itf/templates/test/person_form.html @@ -80,6 +80,8 @@ $(function(){ if ($.trim(id) !== '') { var title = $this.attr("data-title"); $this.select2("val", {'id': id, 'title': title}); + } else { + $this.select2("val", null); } });