Here is example what i try, but didn't work.
What i expect : on button click all options will be unselected.
I try with "refresh" and "render" but also didn't help.
<select class="selectpicker" multiple title="Not changable text" data-count-selected-text="Not changable text">
<option>Mustard</option>
<option>Ketchup</option>
<option>Relish</option>
</select>
<button id="f1">ggg</button>
$('#f1').click(function(){
$('.selectpicker').selectpicker('deselectAll');
});
UPDATE : code doesn't work if select is closed. In case it's open - all is good
There was a bug with deselectAll
and is now fixed
You can empty selection using val
:
$('#f1').click(function(){
$('.selectpicker').selectpicker('val', '');
});
(it does now)DeselectAll
should theoretically do the job, but for some reason it doesn't.