最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Looking for multi-select, scrollable, List component for Bootstrap - Stack Overflow

programmeradmin1浏览0评论

I can't find a scrollable, multi-select List component for Bootstrap; anybody know of one?

Select2 components are great but I want the list expanded at first, not a dropdown.

Bonus if it works handily with Text input component for searching/filtering.

Thanks for any helpful tips!

I can't find a scrollable, multi-select List component for Bootstrap; anybody know of one?

Select2 components are great but I want the list expanded at first, not a dropdown.

Bonus if it works handily with Text input component for searching/filtering.

Thanks for any helpful tips!

Share Improve this question asked May 28, 2013 at 19:27 fumengfumeng 1,8205 gold badges27 silver badges71 bronze badges
Add a comment  | 

4 Answers 4

Reset to default 5

If you are looking for a 2 column select layout, check this out

If you are looking for a multiselect dropdown - Check here

To make the dropdown scrollable add the following css

.multiselect-container {
    height: 200px;  
    overflow-x: hidden;
    overflow-y: scroll;  
}

Bootstrap Dual Listbox use two lists to manage the selections.

In your HTML doc:

<select name="duallistbox[]" multiselect>
    <option value="1">Option 1</option>
    <option value="2">Option 2</option>
    <option value="3">Option 3</option>
    <option value="4">Option 4</option>
    ...
    <option value="10">Option 10</option>
</select>

In your JS script:

$('select[name="duallistbox[]"]').bootstrapDualListbox();

Which results in: Image

I've recently created very simple jQuerUI plugin which mimics multiselection functionality by toggling .active class on the elements.

$(selector).multiselect("selection")

returns an array of indices of the children elemens having class .active.

Scrolling and other styling is done by applying corresponding CSS.

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论