nobleclem/jQuery-MultiSelect

Show "all selected" placeholder when all selected

Closed this issue · 2 comments

Show "all selected" placeholder when all options are selected. Now if all selected, it just shows the count of all options. It would be awesome if there will be a option to change the button text when it's "all selected".

Or is it possible to do with custom code?

i did it manually, by using this code, if someone needs it:

`
$('.select').multiselect({
selectAll: true,
minHeight: null,
onPlaceholder: function(element, placeholder, selectedOpts) {
var totalOpts = $(element).find('option').length;
if(selectedOpts.length === totalOpts) {
setAll($(element).parent(), 'All selected');
}
}
});

function setAll(el, all) {
$(el).find('button span').html(all)
}
`