소스 검색

Merge pull request #1014 from sjschukin/patch-1

.select2("data", null) causes an error
Igor Vaynberg 11 년 전
부모
커밋
f8dda91171
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      select2.js

+ 1 - 1
select2.js

@@ -3233,7 +3233,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 stripDiacritics(''+text).toUpperCase().indexOf(stripDiacritics(''+term).toUpperCase()) >= 0;
         },