rkj
rkj

Reputation: 541

Open the drop down list permanently of select2

I'm using select2 for multiple value selection. I need to display the drop down list permanently.

Right now when we select or click the input box of select2, the drop down list is displayed. I'd like to know if there is any way we can always show the list.

Upvotes: 21

Views: 22013

Answers (2)

Urja Satodiya
Urja Satodiya

Reputation: 412

Try this:

var list = $("#select").select2({
    closeOnSelect: false
}).on("select2:closing", function(e) {
    e.preventDefault();
}).on("select2:closed", function(e) {
    list.select2("open");
});

For Ref Click here

Upvotes: 5

Terence
Terence

Reputation: 1374

From the select2 documentation, here:

    $("#select").select2({
            closeOnSelect: false
    });

Upvotes: 33

Related Questions