Skip to content
This repository was archived by the owner on Oct 2, 2019. It is now read-only.

feat(templates): Support disabled options in select menu. #174

Merged
merged 1 commit into from
Sep 15, 2014

Conversation

miketierney
Copy link
Contributor

This is to address #168.

@zackarychapple
Copy link

Huge +1 to this.


if (itemIndex >= 0) {
item = ctrl.items[itemIndex];
isDisabled = item.disabled;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of having disabled hardcoded maybe could be better to let user specify it as an expression. Something like this:

<ui-select-choices repeat="person in people" disabled="person.active">
     {{person.name}}
</ui-select-choices>

@miketierney
Copy link
Contributor Author

That's a really good call. I’ll add that in.

@dimirc dimirc removed the in progress label Sep 9, 2014
@dimirc dimirc added this to the 0.8.x milestone Sep 9, 2014
@miketierney
Copy link
Contributor Author

@dimirc I've updated this so a user can define a function to trigger the disabled behavior (a la ng-if) on a choice.

@dimirc
Copy link
Contributor

dimirc commented Sep 15, 2014

@miketierney could you remove dist/ files? since I've been only pushing them in specific commits that are for creating a new release (specially for bower). This change will be preferable be on next release (v0.8

@dimirc
Copy link
Contributor

dimirc commented Sep 15, 2014

@miketierney also if you could rebase/squash the commit will be nice

@miketierney miketierney force-pushed the feat-disabled-option branch 2 times, most recently from ce7e668 to 17ceb65 Compare September 15, 2014 01:25
dimirc added a commit that referenced this pull request Sep 15, 2014
feat(templates): Support disabled options in select menu.
@dimirc dimirc merged commit 36ee169 into angular-ui:master Sep 15, 2014
@dimirc
Copy link
Contributor

dimirc commented Sep 15, 2014

👍

@dimirc dimirc mentioned this pull request Oct 9, 2014
@casoich
Copy link

casoich commented Nov 7, 2014

Is there a functional demo of this feature? I can disable at the <ui-select> level, but not the individual <ui-select-choices>...

@mohan-evolent
Copy link

badly need a demo on this feature please.. doen't seem to be working when "disabled:true" attribute is present with the data.

@greenimpala
Copy link

+1 for example

@miketierney
Copy link
Contributor Author

Here's a plunk with it working: http://plnkr.co/edit/Jj5l3PBMnGVAdLKjH44I

I'll work up a PR with a checked-in version of the demo.

@amcdnl
Copy link
Contributor

amcdnl commented Nov 19, 2014

@miketierney
Copy link
Contributor Author

Even better, no PR/checked-in demo necessary.

@casoich
Copy link

casoich commented Nov 19, 2014

OK, thanks, Mike! (It turns out the design was changed to use the ui-select-match element, and to LOCK the elements with the ui-locked-choice attribute.) the disabled menu items works for me!

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

Successfully merging this pull request may close these issues.

7 participants