Explorar o código

Added default selection for AJAX

Kevin Brown %!s(int64=10) %!d(string=hai) anos
pai
achega
d306fcf82c
Modificáronse 1 ficheiros con 4 adicións e 2 borrados
  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;
     }
   });