davidstutz / bootstrap-multiselect

JQuery multiselect plugin based on Twitter Bootstrap.
https://davidstutz.github.io/bootstrap-multiselect/
Other
3.66k stars 1.99k forks source link

Bootstrap multiselect does not work on bootstrap modal popup #1229

Open tayyabchishty opened 2 years ago

tayyabchishty commented 2 years ago

Hi,

I want to show dropdown with checkbox and search filter in Modal Popup, but it is not showing.It is working fine on simple razor view but not working in modal popup.I am working on MVC.

Need help on this

Following javascript code i am using

<script type="text/javascript">
        $(document).ready(function () {
            $('#myDevices').multiselect({
                enableFiltering: true
            });
        });
    </script>
tiesont commented 2 years ago

I am working on MVC.

Probably want to be more specific than that - "MVC" is an acronym for "Model-View-Controller" and can refer to a very long list of implementations.

That being said, you need to apply the multiselect plugin when the modal has been shown, not on page load.

hrustbb2 commented 1 year ago

@tiesont это дерьмо не работает даже вне модалок

tiesont commented 1 year ago

@tiesont это дерьмо не работает даже вне модалок

I have about a half-dozen applications I've written that would say otherwise. But thanks for the helpful feedback.

EonaCat commented 5 months ago

Solution:

Add this to your css:

/ Fix bug for dropDown / .dropdown-menu.show { padding: 10px !important; max-height: 99vh !important; overflow-y: auto !important; overflow-x: hidden !important; }

.multiselect-search { margin-left:5px !important; }