ember-multiselect-checkboxes icon indicating copy to clipboard operation
ember-multiselect-checkboxes copied to clipboard

Disable individual checkboxes

Open nwhittaker opened this issue 8 years ago • 4 comments

Consider allowing for disabling individual checkboxes.

nwhittaker avatar Dec 24 '16 03:12 nwhittaker

That sounds like something for which perhaps a custom template is better suited:

{{#multiselect-checkboxes options=options selection=selectedOptions as |option isSelected|}}
  <li>
    <label>
      {{input type="checkbox" checked=isSelected disabled=option.isDisabled}}
      {{option.label}}
    </label>
  </li>
{{/multiselect-checkboxes}}

Would that work for you?

RSSchermer avatar Dec 24 '16 09:12 RSSchermer

Thank you for the suggestion, but I think the suitability depends on how you interpret the objective of the addon. It'd be nice to use the addon as a way to manage an array of checkboxes, but I understand if your intention is to treat the addon as a new type of input control that happens to render itself as a bunch of checkboxes.

nwhittaker avatar Dec 27 '16 01:12 nwhittaker

I don't think those goals are necessarily mutually exclusive, it's just that I've become somewhat apprehensive about making this addon more complex than it already is. Upon reflection though, perhaps this could be implemented by adding a disabledProperty attribute to the component, which might indeed be a worthwhile addition.

RSSchermer avatar Dec 27 '16 09:12 RSSchermer

Thanks for the consideration. I was also thinking you could pass in an array of disabled options (similar to how the selection attribute passes in an array of selection options) -- but I'm guessing that approach might not scale as well?

nwhittaker avatar Dec 27 '16 14:12 nwhittaker