diff --git a/select2-latest.html b/select2-latest.html index 9e365113..c42c0bd7 100755 --- a/select2-latest.html +++ b/select2-latest.html @@ -925,39 +925,48 @@ $("#e18,#e18_2").select2();
formatSelection(object)+
formatSelection(object, container)
Parameter | Type | Description |
---|---|---|
object | object | The selected result object returned from the query function |
<returns> | string | Html string, a DOM element, or a jQuery object that renders the selection |
container | jQuery object | jQuery wrapper of the node to which the selection should be appended |
<returns> | string (optional) | Html string, a DOM element, or a jQuery object that renders the selection |
text
property that is returned.
+ The default implementation expects the object to have a text
property that is returned.
The implementation may choose to append elements directly to the provided container
object, or return a single value and have it automatically appended
<option>
(or <optgroup>) element is accessible inside the specified function through the property item.element
:
+
+ When attached to a select
the original <option>
(or <optgroup>) element is accessible inside the specified function through the property item.element
:
format(item) { var originalOption = item.element; - // return item.text + return item.text }+
formatResult(object)+
formatResult(object, container, query)
Parameter | Type | Description |
---|---|---|
object | object | One of the result objects returned from the query function |
<returns> | string | Html that represents the result |
container | jQuery object | jQuery wrapper of the node that should contain the representation of the result |
query | object | The query object used to request this set of results |
<returns> | string (optional) | Html string, a DOM element, or a jQuery object that represents the result |
text
property that is returned.
+ The default implementation expects the object to have a text
property that is returned.
The implementation may choose to append elements directly to the provided container
object, or return a single value and have it automatically appended
<option>
(or <optgroup>) element is accessible inside the specified function through the property item.element
:
+
+ When attached to a select
the original <option>
(or <optgroup>) element is accessible inside the specified function through the property item.element
:
format(item) { var originalOption = item.element; - // return item.text + return item.text }+