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

"Simulate single selections using checkboxes" Example not working in docs #1247

Open
LucasRoquilly opened this issue Dec 22, 2022 · 0 comments

Comments

@LucasRoquilly
Copy link

LucasRoquilly commented Dec 22, 2022

Hello,

Thanks to all those contributing.

It seems to me an example in the docs is not working. It is the "Simulate single selections using checkboxes" example.

I changed this code (which is in the docs)

<script type="text/javascript">
    $(document).ready(function() {
        $('#example-simulate-single').multiselect({
            on: {
                change: function(option, checked) {
                    var values = [];
                    $('#example-simulate-single option').each(function() {
                        if ($(this).val() !== option.val()) {
                            values.push($(this).val());
                        }
                    });
                    $('#example-simulate-single').multiselect('deselect', values);
                }
            }
        });
    });
</script>

to this code below to make it work

<script type="text/javascript">
    $(document).ready(function() {
        $('#example-simulate-single').multiselect({
                onChange: function(option, checked) {
                    var values = [];
                    $('#example-simulate-single option').each(function() {
                        if ($(this).val() !== option.val()) {
                            values.push($(this).val());
                        }
                    });
                    $('#example-simulate-single').multiselect('deselect', values);
                }
        });
    });
</script>

I suggest updating the docs if this is confirmed

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