Sachin Prasad
Sachin Prasad

Reputation: 5411

bootstrap multiselect checkboxes should be visible on the page

I want the bootstrap multiselect to be visible on the page by default and it shouldn't toggle. Its functionality should be similar to default multiselect with check boxes.

I added this style to make it look as if it is on the page:

ul.multiselect-container{
    position: relative;
    box-shadow: none;
}

But I also want that it shouldn't get hidden when I click outside the page. Any Idea?

Upvotes: 0

Views: 792

Answers (1)

Siva.G ツ
Siva.G ツ

Reputation: 839

I have used the below code to show checkboxes onLoad

if ($('select').next().hasClass('btn-group')) {
    $('select').next().addClass('open');
}

Then I used onDropdownHidden to prevent dropdown close

$('.multiselect').multiselect({
    onDropdownHidden: function (event) {
        $('select').next().addClass('open');
    }
});

FIDDLE DEMO

Upvotes: 1

Related Questions