jQuery Chosen plugin without search field

前端 未结 12 870
时光说笑
时光说笑 2021-02-05 02:45

Not sure if this has been covered somewhere, but I couldn\'t find it in the documentation, and was wondering if it\'d be possible to not include the search input box with the jQ

12条回答
  •  盖世英雄少女心
    2021-02-05 03:10

    The disable_search_threshold option hides the search box for single select dropdowns. The number passed in specifies how many items you want to allow before showing the search box. If you don't want the searchbox, just set it to a higher number than the amount of items it will ever contain.

    $('#myDropDown').chosen({ disable_search_threshold: 10 });
    

提交回复
热议问题