소스 검색

Added default selection for AJAX

Kevin Brown 10 년 전
부모
커밋
d306fcf82c
1개의 변경된 파일4개의 추가작업 그리고 2개의 파일을 삭제
  1. 4 2
      docs/examples.html

+ 4 - 2
docs/examples.html

@@ -170,7 +170,9 @@ $(".js-example-data-array-selected").select2({
       </p>
 
       <p>
-        <select class="js-example-data-ajax form-control"></select>
+        <select class="js-example-data-ajax form-control">
+          <option value="ivaynberg/select2" selected="selected">ivaynberg/select2</option>
+        </select>
       </p>
 
       <pre data-fill-from=".js-code-data-ajax"></pre>
@@ -543,7 +545,7 @@ $.fn.select2.amd.require(
       return markup;
     },
     templateSelection: function (repo) {
-      return repo.full_name;
+      return repo.full_name || repo.text;
     }
   });