问题
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