%PDF- <> %âãÏÓ endobj 2 0 obj <> endobj 3 0 obj <>/ExtGState<>/ProcSet[/PDF/Text/ImageB/ImageC/ImageI] >>/Annots[ 28 0 R 29 0 R] /MediaBox[ 0 0 595.5 842.25] /Contents 4 0 R/Group<>/Tabs/S>> endobj ºaâÚÎΞ-ÌE1ÍØÄ÷{òò2ÿ ÛÖ^ÔÀá TÎ{¦?§®¥kuµùÕ5sLOšuY>endobj 2 0 obj<>endobj 2 0 obj<>endobj 2 0 obj<>endobj 2 0 obj<> endobj 2 0 obj<>endobj 2 0 obj<>es 3 0 R>> endobj 2 0 obj<> ox[ 0.000000 0.000000 609.600000 935.600000]/Fi endobj 3 0 obj<> endobj 7 1 obj<>/ProcSet[/PDF/Text/ImageB/ImageC/ImageI]>>/Subtype/Form>> stream
<section> <h1 id="matcher">Customizing how results are matched</h1> <p> 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: </p> <p> This custom matcher uses a <a href="options.html#compat-matcher">compatibility module</a> that is only bundled in the <a href="index.html#builds-full">full version of Select2</a>. You also have the option of using a <a href="options.html#matcher">more complex matcher</a>. </p> <div class="s2-example"> <p> <select class="js-example-matcher-start js-states form-control"></select> </p> </div> {% highlight js linenos %} function matchStart (term, text) { if (text.toUpperCase().indexOf(term.toUpperCase()) == 0) { return true; } return false; } $.fn.select2.amd.require(['select2/compat/matcher'], function (oldMatcher) { $(".js-example-matcher-start").select2({ matcher: oldMatcher(matchStart) }) }); {% endhighlight %} </section>