diff --git a/select2-latest.html b/select2-latest.html index e2309c9e..6c1cab05 100644 --- a/select2-latest.html +++ b/select2-latest.html @@ -1395,6 +1395,26 @@ format(item) { must be taken to sanitize the id attribute of the choice object, especially stripping , as it is used as a value separator.

+ createSearchChoicePositionstring|function + Define the position where to insert element created by createSearchChoice. The following values are supported: +
+
top
Insert in the top of the list
+
bottom
Insert at the end of the list
+
<function>
+
+

A custom function. For example if you want to insert the new item in the second position:

+
+$("#tags").select2({
+    ...
+    createSearchChoice: function(term) { ... },
+    createSearchChoicePosition: function(list, item) {
+        list.splice(1, 0, item);
+    }
+});
+
+
+
+ initSelectionfunction Called when Select2 is created to allow the user to initialize the selection based on the value of the element select2 is attached to.