+
+ Custom Matcher
+Unlike other dropdowns on this page, this one matches options only if the term appears in the beginning of the string as opposed to anywhere
+
+
+ Example Code
+++
diff --git a/select2-latest.html b/select2-latest.html index e77acb29..021356e1 100755 --- a/select2-latest.html +++ b/select2-latest.html @@ -195,6 +195,7 @@ $("#e10_3").select2({
Unlike other dropdowns on this page, this one matches options only if the term appears in the beginning of the string as opposed to anywhere
+++
id
property that is returned.
+ select
, or the local
or tags
helpers are used.
+ matcher(term, text)+
Parameter | Type | Description |
---|---|---|
term | string | search term |
text | string | text of the option being matched |
<returns> | boolean | true if search term matches the option text, or false otherwise |
function(term, text) { return text.toUpperCase().indexOf(term.toUpperCase())>0; }
+ formatSelection(object)diff --git a/select2-master b/select2-master index 4b451fee..4ba25b80 160000 --- a/select2-master +++ b/select2-master @@ -1 +1 @@ -Subproject commit 4b451fee8186af903911263ff756686e62b7e801 +Subproject commit 4ba25b80951f18524f6e9f078e1d1e938975dbac