diff --git a/select2-latest.html b/select2-latest.html index 66626810..77a0bd71 100644 --- a/select2-latest.html +++ b/select2-latest.html @@ -669,6 +669,7 @@ $("#e11") .on("select2-close", function() { log("close"); }) .on("select2-highlight", function(e) { log ("highlighted val="+ e.val+" choice="+ JSON.stringify(e.choice));}) .on("select2-selecting", function(e) { log ("selecting val="+ e.val+" choice="+ JSON.stringify(e.choice));}) + .on("select2-removing", function(e) { log ("removing val="+ e.val+" choice="+ JSON.stringify(e.choice));}) .on("select2-removed", function(e) { log ("removed val="+ e.val+" choice="+ JSON.stringify(e.choice));}) .on("select2-loaded", function(e) { log ("loaded (data property omitted for brevitiy)");}) .on("select2-focus", function(e) { log ("focus");}) @@ -680,6 +681,7 @@ $("#e11_2") .on("select2-close", function() { log("close"); }) .on("select2-highlight", function(e) { log ("highlighted val="+ e.val+" choice="+ JSON.stringify(e.choice));}) .on("select2-selecting", function(e) { log ("selecting val="+ e.val+" choice="+ JSON.stringify(e.choice));}) + .on("select2-removing", function(e) { log ("removing val="+ e.val+" choice="+ JSON.stringify(e.choice));}) .on("select2-removed", function(e) { log ("removed val="+ e.val+" choice="+ JSON.stringify(e.choice));}) .on("select2-loaded", function(e) { log ("loaded (data property omitted for brevitiy)");}) .on("select2-focus", function(e) { log ("focus");}) @@ -1717,6 +1719,20 @@ $("#select").select2({

For the clear button to be visible the allowClear option needs to be true.

+
+
+

select2-removing

+

Fired when a choice is about to be removed in the dropdown/input, but before any removal of the choice has been made. + This event is used to allow the user to reject removal by calling event.preventDefault()

+

+

The event object contains the following custom properties: +

+
val
The id of the removing choice object.
+
object
The choice object about to be removed.
+
+

+
+

select2-removed