bootstrap-multiselect
bootstrap-multiselect copied to clipboard
Simulate single selections using checkboxes : documentation isn't updated
Hi, just a note about the documentation example Simulate single selections using checkboxes. The code in the example doesn't correspond to the real code.
Please, can you update your documentation ?
This doesn't work :
$('#example-simulate-single').multiselect({
on: {
change: function(option, checked) {
var values = [];
$('#example-simulate-single option').each(function() {
if ($(this).val() !== option.val()) {
values.push($(this).val());
}
});
$('#example-simulate-single').multiselect('deselect', values);
}
}
});
Do this :
$('#example-simulate-single').multiselect({
onChange: function(option, checked) {
var values = [];
$('#example-simulate-single option').each(function() {
if ($(this).val() !== option.val()) {
values.push($(this).val());
}
});
$('#example-simulate-single').multiselect('deselect', values);
}
});