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

Support for option disabled property? #476

Closed
Nevario opened this issue Jan 25, 2015 · 4 comments
Closed

Support for option disabled property? #476

Nevario opened this issue Jan 25, 2015 · 4 comments

Comments

@Nevario
Copy link

Nevario commented Jan 25, 2015

Hello,

Firstly, brilliant plugin! Thank-you.

I'm trying to programatically disable/enable options in the multiselect but it doesn't seem to support the multi select disabled option.

<option value="Mo" disabled="disabled">Monday</option>

It also doesn't appear to support it via the dataprovider object

  {label: 'Option 1', title: 'Option 1', value: '1', disabled: true},
  {label: 'Option 2', title: 'Option 2', value: '2'},

Could I be missing something or is this currently not possible?

Tim

@SaeedSoltoon
Copy link

Hi Tim.
you can simply add a css class to the option "li" tag.

var Options = $('#your-container-id option').filter(function () {
return !$(this).is(':selected');
});

        Options.each(function () {
            var input = $('input[value="' + $(this).val() + '"]');
            input.prop('disabled', true);
            input.parent('li').addClass('disabled');
        });

@davidstutz
Copy link
Owner

For the dataprovider, the enabled or disabled options do currently not exist. But I will have a look at the dataprovider anyway (see #469).

@addingama
Copy link

Is this feature added?

@davidstutz
Copy link
Owner

This was added.

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

No branches or pull requests

4 participants