I am using bootstrap's multiselect with enableCollapsibleOptGroups
set to true.
What I have now:
I want to have optgroups collapsed by default:
David's answer didn't work for me. But these two solutions worked:
Solution 1:
buttonContainer: '<div id="example-enableCollapsibleOptGroups-collapsed-container" />',
onDropdownShown: function() {
$('#example-enableCollapsibleOptGroups-collapsed-container .caret-container').click();
},
onDropdownHidden: function() {
$('#example-enableCollapsibleOptGroups-collapsed-container .caret-container').click();
}
Solution 2:
buttonContainer: '<div id="example-enableCollapsibleOptGroups-collapsed-container" />'
Then:
setTimeout( function(){
$('#example-enableCollapsibleOptGroups-collapsed-container .caret-container').click();
} , 2000 );