Bootstrap MultiSelect with Checkbox - Trigger from the ListBox itself

我怕爱的太早我们不能终老 提交于 2021-01-29 11:23:06

问题


I implemented the MultiSlect dropdown with checkboxes using the excellent plugin http://davidstutz.github.io/bootstrap-multiselect/

   @Html.ListBoxFor(m => Model.DepDashTaskLists[i].BusinessRuleQuestion1Answer, new MultiSelectList(slh.GetRegistrationAnswerLookup(Model.DepDashTaskLists[i].BusinessRuleQuestion1), "Value", "Text", Model.DepDashTaskLists[i].BusinessRuleAnswers), new { multiple = "multiple", @id = "RuleQuestionListBoxAnswer", @class = "listbox", @rows = "2", @columns = "40" })

Javascript:

  $(function () {
       // $('#RuleQuestionListBoxAnswer').multiselect();
        $('.listbox').multiselect({
            includeSelectAllOption: true
        });
    });
                         

my only issue is that both the asp.net mvc dropdown is coming and the plugin dropdown are coming

This is awkward from a user experience , is there a way to have the dropdown with checkbox open upon clicking in the listbox itself. If not can I at least disable the listbox dropdown? I see that there ways to customize https://github.com/davidstutz/bootstrap-multiselect/#styling, but I am not heavily experienced in CSS, and not sure if its possible to completely eliminate the button and trigger the checkbox dropdown on click inside the listbox.

来源:https://stackoverflow.com/questions/65569599/bootstrap-multiselect-with-checkbox-trigger-from-the-listbox-itself

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!