diff --git a/select2-latest.html b/select2-latest.html index 7806ffda..4731f68d 100644 --- a/select2-latest.html +++ b/select2-latest.html @@ -634,10 +634,14 @@ function log(e) { } $("#e11") .on("change", function(e) { log(JSON.stringify({val:e.val, added:e.added, removed:e.removed})); }) - .on("open", function() { log("open"); }); + .on("opening", function() { log("opening"); }) + .on("open", function() { log("open"); }) + .on("highlight", function(e) { log ("highlighted val="+ e.val+" choice="+ JSON.stringify(e.choice));}); $("#e11_2") .on("change", function(e) { log(JSON.stringify({val:e.val, added:e.added, removed:e.removed})); }) - .on("open", function() { log("open"); }); + .on("opening", function() { log("opening"); }) + .on("open", function() { log("open"); }) + .on("highlight", function(e) { log ("highlighted val="+ e.val+" choice="+ JSON.stringify(e.choice));}); });
@@ -1386,6 +1390,8 @@ $("#tags").select2({ <returns>objectResults object. See "options.callback" in the "query" function for format. + paramsobject/functionAn object or a function that returns an object that contains extra parameters that will be passed to the transport. For example it can be used to set the content type: {contentType: "application/json;charset=utf-8"} +

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

@@ -1514,7 +1520,6 @@ $("#tags").select2({

change

Fired when selection is changed.

-

This event is not fired when the selection is changed using Select2's val() method.

The event object contains the following custom properties:

val
the current selection (taking into account the result of the change) - id or array of ids
@@ -1526,18 +1531,38 @@ $("#tags").select2({
-

open

-

Fired when the dropdown is shown.

+

opening

+

Fired before the dropdown is shown.

The event listener can prevent the opening by calling preventDefault() on the supplied event object.

+
+
+

open

+

Fired after the dropdown is shown.

+

+
+
+
+
+

highlight

+

Fired when a choice is highlighted in the dropdown.

+

+

The event object contains the following custom properties: +

+
val
the id of the highlighted choice object
+
object
the highlighted choice object
+
+

+
+
-

Configuring Defaults

+

Configuring Defaults

Select2 exposes its default options via the $.fn.select2.defaults object. Properties changed in this object (same properties configurable through the constructor) will take effect for every instance created after the change
diff --git a/select2-master b/select2-master index 640e7066..2f53c251 160000 --- a/select2-master +++ b/select2-master @@ -1 +1 @@ -Subproject commit 640e7066d9f1c836008aa27fccfa491fc70f4a3b +Subproject commit 2f53c251d451d75b1572ca2cc61aecf2c92b5eae