From 4a0851bce51e4e279f4bd6edb26b3940d0c2a117 Mon Sep 17 00:00:00 2001 From: Igor Vaynberg Date: Thu, 11 Apr 2013 19:15:16 -0700 Subject: [PATCH] Array data with custom key (string) isn't returning matches. fixes #1179 --- select2.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/select2.js b/select2.js index 58fa9ed6..09b0ffa0 100644 --- a/select2.js +++ b/select2.js @@ -441,7 +441,7 @@ the specific language governing permissions and limitations under the Apache Lic text = dataItem.text; // if text is not a function we assume it to be a key name if (!$.isFunction(text)) { - dataText = data.text; // we need to store this in a separate variable because in the next step data gets reset and data.text is no longer available + dataText = dataItem.text; // we need to store this in a separate variable because in the next step data gets reset and data.text is no longer available text = function (item) { return item[dataText]; }; } } @@ -2641,7 +2641,6 @@ the specific language governing permissions and limitations under the Apache Lic // multi buildChangeDetails: function (old, current) { - console.log("current", current, "old", old); var current = current.slice(0), old = old.slice(0);