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));}); });
{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
.
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:
Fired when the dropdown is shown.
+Fired before the dropdown is shown.
The event listener can prevent the opening by calling preventDefault()
on the supplied event object.
Fired after the dropdown is shown.
+ +Fired when a choice is highlighted in the dropdown.
+ +The event object contains the following custom properties: +
$.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