hello, it is possible to have select all checked by default and if another option/group is selected to uncheck select all? thx.
You could simply select all options in advance. Then the select all option would be selected automatically. Alternatively you can invoke .multiselect('selectAll')
after calling the plugin. Does this solve your problem?
Hi,
As I could not clearly understand your solution without example, can you please clarify on how do I populate all multi-select drop-down box by default on page load providing a full example. At the moment I'm using:
$('.dropdown').multiselect({
includeSelectAllOption: true,
enableFiltering: true
}, 'selectAll');
It does not work with 'selectAll' param
Thanks in advance.
Hi,
after a lot of readings and documentations, I manage to solve this. Please read my solution here:
http://stackoverflow.com/questions/26468662/bootstrap-multiselect-keep-selection-on-change
Hi,
is there an attribute to plugin in working example as selectAll we can add having simpler solution ?
Thanks for the link.
Here is the solution:
$(document).ready(function() {
$('#dropdown1).multiselect({
includeSelectAllOption: true,
allSelectedText: 'All Selected'
});
$("#dropdown1").multiselect('selectAll', false);
$("#dropdown1").multiselect('updateButtonText');
});
@jeffdoan Thanks, this worked perfectly.
Ok, seems to be solved, will add this to the FAQ.
@jeffdoan it working fine, The options are getting checked on the page load. But facing one issue where the value in the dropdown box showing "None Selected" on the page load. but when you open dropdown all will be selected then just toggle select all its start showing all selected. Can you provide a solution if any
None of these solutions worked.
I need to build some jquery to solve this
$(".csTsContentType").find(".multiselect-selected-text").html("All");
$(".csTsContentType").find("input").each(function () {
$(this).prop('checked', true)
});
i solved this
$('#courts option').prop 'selected', true
$('#courts').multiselect 'refresh'
_coffee_
You could simply select all options in advance. Then the select all option would be selected automatically. Alternatively you can invoke
.multiselect('selectAll')
after calling the plugin. Does this solve your problem?
this doesn't work :(
$('#ddlColumn').multiselect('selectAll', true);
$('#ddlColumn').multiselect('updateButtonText');
this is working perfectly in ondropdownshow method or any method but by default it didnt work
since i have dynamically populated the multi select the only working solution is below
var results = response;
if (results.length > 0) {
var columnsIn = results[0];
for (var key in columnsIn) {
var col = new Object();
col.data = key;
col.title = key;
col.value = key;
col.label = key;
var htm = '';
htm += '<option selected>' + col.value + '</option>';
$('#dropdownname').append(htm);
}
$('#dropdownname').multiselect("rebuild");
this one is not working for me
this one is not working for me
what is not working?
Most helpful comment
Here is the solution:
$(document).ready(function() {
$('#dropdown1).multiselect({
includeSelectAllOption: true,
allSelectedText: 'All Selected'
});