Objective:
Similar to .selectpicker('toggle') , options like close and open are required
.selectpicker('open') open all pickers.selectpicker('close') close all pickersPurpose:
sometimes it is required to close down all bootstrap-select pickers while .selectpicker('toggle')only switched between open and closed states.
These options will help in achieve either opening or closing one or more selectpickers
Solution:
Tests:
Sample:
added open: function (e) { and close: function (e) { after toggle in source
toggle: function (e) {
e = e || window.event;
if (e) e.stopPropagation();
this.$button.trigger('click');
},
open: function (e) {
e = e || window.event;
if (e) e.stopPropagation();
if (!this.$newElement.hasClass('open')) this.$button.trigger('click');
},
close: function (e) {
e = e || window.event;
if (e) e.stopPropagation();
if (this.$newElement.hasClass('open')) this.$button.trigger('click');
},
+1
What is the status of this issue please?
Is there a way to close the select programmatically?
I only see method for toggle and that's not really what I need. Or is there a way to query whether select is opened so I could filter the opened ones and close them by toggle?
This change will be a part of the v1.14.0 release. This issue will be updated after it's made available.
Released in v1.14.0-beta!
Most helpful comment
+1