我使用bootstrap multiselect
插件將動態代碼添加到select中。這裏是我的代碼:Bootstrap multiselect在Instanciation中選擇所有選項
HTML:
<label>
<span>Underlyings</span>
<select class="multiselect" multiple></select>
</label>
的Javascript
var name = ['joe', 'mary', 'rose'];
R.map(function (x) {
return $('.multiselect', d.el).append("<option>" + x + "</option>");
}, name);
$('.multiselect', d.el).multiselect({
allSelectedText: 'All',
maxHeight: 200,
includeSelectAllOption: true
});
當多個選擇的instancied,它顯示爲這樣的瀏覽器(有一些CSS格式解釋其方面):
而我想它顯示爲(與instanciation選擇了所有複選框,沒有對「全選」點擊):
我看着文檔,但沒有找到它...
Bootstrap multiple select documentation
在以前的嘗試我設置'selectAll'爲false和'updateButtonText'...已接近但感謝您的努力和工作示例! –
allSelectedText已過時,請使用selectAllText代替,證明:http://davidstutz.github.io/bootstrap-multiselect/#configuration-options-selectAllName – VoVaVc