user598082
user598082

Reputation: 25

Bootstrap multiselect dropdown multiple instance

I have two bootstrap multiselect dropdown in a page. Whenever i click on "select all" checkbox in one dropdown the "select all" checkbox from other dropdown gets checked. Don't know how to solve this one.

Thanks

Upvotes: 1

Views: 1056

Answers (3)

Mac
Mac

Reputation: 181

its old question but i think it might help someone you just have to pass different class or id to the list thats get generated . for example in bootstrap-multiple.js file there is one element named : `buttonContainer: '',' you can change this while you call the multiselect like this :

    $('#idofthefirstselectelement').multiselect({
                buttonContainer: '<div class="btn-group pull-right" id="whateveridyouwish" />',
            });
$('#idofthesecondselectelement').multiselect({
                buttonContainer: '<div class="btn-group pull-right" id="whateveridyouwish" />',


            });

and in your datatable preparation method append/attach it like this

"initComplete": function(settings, json) {
                    $('#idoffirstmaindiv .dt-buttons').append($('#whateveridyouwish'));
                },

Upvotes: 0

user598082
user598082

Reputation: 25

This issue is resolved with the help of this https://github.com/davidstutz/bootstrap-multiselect/issues/751

Upvotes: 1

Justin
Justin

Reputation: 122

Sounds like your <select> elements may have the same ID.

Upvotes: 0

Related Questions