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

deselect all removes pre-selected disabled items #259

Open
SA751F opened this issue Dec 6, 2016 · 2 comments
Open

deselect all removes pre-selected disabled items #259

SA751F opened this issue Dec 6, 2016 · 2 comments

Comments

@SA751F
Copy link

SA751F commented Dec 6, 2016

I see that plugin supports having pre-selected disabled options, so that they cannot be removed. It works fine otherwise, But deselect_all doesnt take those into account.

@BoboMcKane
Copy link

have the same problem, when calling deselect_all also the disabled options in the "right" list are moved to the "left" one, while remain disabled. When calling select_all after that, this elements remain in the left list.
Is there a solution for that case, since the post is more than 3 years old??

@konpa
Copy link

konpa commented Jun 25, 2020

Same here. Ended up doing something like this

$('#js-selection').multiSelect('deselect_all');
$('#disabledOption').removeAttr('disabled');
$('#js-selection').multiSelect('refresh');
$('#js-selection').multiSelect('select', $('#disabledOption').val());
$('#disabledOption').attr('disabled', true);
$('#js-selection').multiSelect('refresh');

Not pretty but it's working...

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

3 participants