From 1cff8d4d22990cb99fef3127c6dc725b3aa36b76 Mon Sep 17 00:00:00 2001 From: sjschukin Date: Tue, 12 Mar 2013 16:35:14 +0400 Subject: [PATCH] Update select2.js bugfix: .select2("data", null) for remote datasource causes an error "ReferenceError: e is not defined" --- select2.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/select2.js b/select2.js index 394ea167..c6e4cb13 100644 --- a/select2.js +++ b/select2.js @@ -2701,7 +2701,7 @@ the specific language governing permissions and limitations under the Apache Lic minimumInputLength: 0, maximumInputLength: null, maximumSelectionSize: 0, - id: function (e) { return e.id; }, + id: function (e) { return e == undefined ? null : e.id; }, matcher: function(term, text) { return (''+text).toUpperCase().indexOf((''+term).toUpperCase()) >= 0; },