我想显示选定的值,例如(this screenshot is mixed)
不是buttonText(没有选中,全部选中,4选中......)
这是我的多选代码:
<script type="text/javascript">
$(document).ready(function () {
$('#product_reset_btn').on('click', function () {
$('#product_choice_multi').multiselects('deselectAll',false);
});
$('#product_choice_multi').multiselects({
//buttonContainer: '<div></div>',
includeSelectAllOption: true,
maxHeight: 200,
enableClickableOptGroups: true,
buttonClass: '',
templates: {
button: '<span class="multiselect dropdown-toggle" data-toggle="dropdown">product<img src="/~~~~?~?"></span>'
},
onChange: function (element, checked) {
var brands = $('#product_choice_multi option:selected');
var selected = [];
$(brands).each(function (index, brand) {
selected.push([$(this).val()]);
});
}
});
});
</script>