From 3d24fbdf2959d0001e1c3d37426a194b1b5d1a4e Mon Sep 17 00:00:00 2001 From: Igor Vaynberg Date: Mon, 16 Jul 2012 00:31:37 +0300 Subject: [PATCH] catch up to master --- select2-latest.html | 29 +++++++++++++++++++---------- select2-master | 2 +- 2 files changed, 20 insertions(+), 11 deletions(-) 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(); formatSelectionfunction Function used to render the current selection. -
formatSelection(object)
+
formatSelection(object, container)
- + +
ParameterTypeDescription
objectobjectThe selected result object returned from the query function
<returns>stringHtml string, a DOM element, or a jQuery object that renders the selection
containerjQuery objectjQuery 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
- The default implementation expects the object to have a 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



- Original <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
                     }
                 
+

formatResultfunction Function used to render a result that the user can select. -
formatResult(object)
+
formatResult(object, container, query)
- + + +
ParameterTypeDescription
objectobjectOne of the result objects returned from the query function
<returns>stringHtml that represents the result
containerjQuery objectjQuery wrapper of the node that should contain the representation of the result
queryobjectThe 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
- The default implementation expects the object to have a 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



- Original <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
                     }
                 
+

formatNoMatchesfunction Function used to render the "No matches" message diff --git a/select2-master b/select2-master index 1605a631..d6f506e1 160000 --- a/select2-master +++ b/select2-master @@ -1 +1 @@ -Subproject commit 1605a631e5e35e920fecc57ff24c84056be705fc +Subproject commit d6f506e16bbec859bb9fc39e1467112ed422ec0c