简体   繁体   English

Bootstrap Selectpicker-noneResultsText无法与optgroup一起使用

[英]Bootstrap Selectpicker - noneResultsText is not working with optgroup

I am using bootstrap selectpicker to make the custom select box. 我正在使用bootstrap selectpicker制作自定义选择框。 Problem is noneResultsText is not coming with optgroup, when i am removing optgroup noneResultsText is working fine. 问题是noneResultsText不是随optgroup一起提供的,当我删除optgroup时noneResultsText可以正常工作。 Not sure what would be the solution. 不知道该怎么解决。

HTML: HTML:

<select class="selectpicker" data-live-search="true" >
    <optgroup label="Picnic">
       <option>Alabama</option>
       <option>Alaska </option>
       <option>Arizona </option>    
    </optgroup>
</select>

JS: JS:

$('.selectpicker').selectpicker({
           noneResultsText: 'I found no results'
      });

Working example : http://jsfiddle.net/9abm0hhy/24/ 工作示例: http : //jsfiddle.net/9abm0hhy/24/

我得到了解决方案,我只是用更新的版本更新了selectpicker.js,noneResulttet开始工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM