hide-search.html 571 B

12345678910111213141516171819202122
  1. <section>
  2. <h1 id="hide-search">Hiding the search box</h1>
  3. <p>
  4. Select2 allows you to hide the search box depending on the number of
  5. options which are displayed. In this example, we use the value
  6. <code>Infinity</code> to tell Select2 to never display the search box.
  7. </p>
  8. <div class="s2-example">
  9. <p>
  10. <select class="js-example-basic-hide-search js-states form-control"></select>
  11. </p>
  12. </div>
  13. {% highlight js linenos %}
  14. $(".js-example-basic-hide-search").select2({
  15. minimumResultsForSearch: Infinity
  16. });
  17. {% endhighlight %}
  18. </section>