Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
urlicht opened this issue Dec 18, 2022 · 0 comments

Comments

@urlicht
Copy link

urlicht commented Dec 18, 2022

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant