diff --git a/select2-latest.html b/select2-latest.html index 06715bc5..4347acf2 100755 --- a/select2-latest.html +++ b/select2-latest.html @@ -979,13 +979,42 @@ $("#tags").select2({ Callback function that should be called with the result object. The result object: - +
ParameterTypeDescription
result.results[object]Array of result objects. The default renderers expect objects with id and text keys. The id attribute is required, even if custom renderers are used.
result.results[object]Array of result objects. The default renderers expect objects with id and text keys. The id attribute is required, even if custom renderers are used. The object may also contain a childrenkey if hierarchical data is displayed.
result.morebooleantrueif more results are available for the current search term
results.contextobjectA user-defined object that should be made available as the context parameter to the query function on subsequent queries to load more result pages for the same search term. See the description of options.context parameter.

In order for this function to work Select2 should be attached to a input type='hidden' tag instead of a select.

+

+

Example Data

+
+{
+     more: false,
+     results: [
+        { id: "CA", text: "California" },
+        { id: "AL", text: "Alabama" }
+     ]
+}
+                        
+

+

+

Example Hierarchical Data

+
+{
+    more: false,
+    results: [
+        { text: "Western", children: [
+            { id: "CA", text: "California" },
+            { id: "AZ", text: "Arizona" }
+        ] },
+        { text: "Eastern", children: [
+            { id: "FL", text: "Florida" }
+        ] }
+    ]
+}
+                        
+

ajaxobject diff --git a/select2-master b/select2-master index 45442aa8..89ee75dd 160000 --- a/select2-master +++ b/select2-master @@ -1 +1 @@ -Subproject commit 45442aa8d7a4aabb62733f22d28ec0a72cee786f +Subproject commit 89ee75dd9d809d5bec923109330f6b6b6517aca1