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({
result
object. The result object:
Parameter | Type | Description |
---|---|---|
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 children key if hierarchical data is displayed. |
result.more | boolean | true if more results are available for the current search term |
results.context | object | A 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
.
+
+{ + more: false, + results: [ + { id: "CA", text: "California" }, + { id: "AL", text: "Alabama" } + ] +} ++ +
+
+{ + more: false, + results: [ + { text: "Western", children: [ + { id: "CA", text: "California" }, + { id: "AZ", text: "Arizona" } + ] }, + { text: "Eastern", children: [ + { id: "FL", text: "Florida" } + ] } + ] +} ++