bootstrap-select icon indicating copy to clipboard operation
bootstrap-select copied to clipboard

Programmatically toggle options for multiple select to trigger changed.bs.select

Open urlicht opened this issue 3 years ago • 0 comments

For multiple selection case, it'd be nice to be able to programmatically toggle options so that it triggers changed.bs.select with the flipped/toggled index available to be used with changed.bs.select.

For example:

.select.selectpicker('toggle', 'option');

And then:

.select.on('changed.bs.select', function (e, clickedIndex, isSelected, previousValue) {
    // clickedIndex is available with the toggle option index
    ...
}

It seems like toggle currently means toggling the UI, so a different function name might be needed (e.g. switch)

Or is there a streamlined way to implement this with the existing functionalities?

urlicht avatar Dec 18 '22 19:12 urlicht