Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

select2: control how many options to show

Tags:

jquery

I have a select box that shows about 7 options. How can I make select2 show more options?

<td class="span4"><select id="tec" class="span4"><option></option>
    <option>A1</option><option>A2</option><option>C1</option>
    <option>C2</option><option>C3</option><option>E1</option>
    <option>E2</option><option>G1</option><option>G2</option>
    </select>
</td>

It's about showing more choices, not about selecting

like image 401
f p Avatar asked Jul 26 '13 17:07

f p


2 Answers

All select2 containers can be set the same height.

I just added this style, it's working for me

.select2-container--default .select2-results > .select2-results__options {
    max-height: 400px;
}
like image 91
Arun Prasad E S Avatar answered Sep 20 '22 20:09

Arun Prasad E S


This worked:

html:

<select class="bigdrop">

jquery:

$(".bigdrop .select2-results").css("max-height","400px");
like image 28
f p Avatar answered Sep 19 '22 20:09

f p