diff --git a/select2-latest.html b/select2-latest.html index db8776dc..623a37f9 100755 --- a/select2-latest.html +++ b/select2-latest.html @@ -778,6 +778,16 @@ $("#e16_disable").click(function() { $("#e16,#e16_2").select2("disable"); }); $(document).ready(function () { $("#e17").select2({ matcher: function(term, text) { return text.toUpperCase().indexOf(term.toUpperCase())==0; } +}); +// +$("#e17_2").select2({ + matcher: function(term, text, opt) { + return text.toUpperCase().indexOf(term.toUpperCase())>=0 + || opt.attr("alt").toUpperCase().indexOf(term.toUpperCase())>=0; + } }); }); @@ -785,6 +795,8 @@ $("#e17").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
The dropdown below matches on custom attributes of the option
tag. For example, the `blue` option can be matched by entering either `blue` or `cyan`.