angular-ui / ui-select

AngularJS-native version of Select2 and Selectize
MIT License
3.26k stars 1.81k forks source link

Selecting a group #411

Open danhaller opened 9 years ago

danhaller commented 9 years ago

Hi,

I'm interested in selecting a group header to filter by all of the members of that group. I've made this crudely work by just calling ctrl.select when a group is selected and checking whether .items is present to determine what my ui-select-match expression should look like.

I'm happy to do a pull request to add this functionality but wanted to check:

  1. Whether it's actually wanted or was deliberately omitted (select2 has this functionality)
  2. Whether I should be calling the existing select functionality or adding new callbacks etc.
  3. Should selection add the group name or the group members to the input box, and the same question goes for the model.

Essentially I don't want to pull request something that is really opinionated towards just my use case...

Thanks

cmddavid commented 8 years ago

+1

Would be a useful feature. I'm also thinking about adding this to one of my apps.

user378230 commented 8 years ago

For reference: Someone attempted to do this in #1527, its not in a fit state to be considered for merge but you may find the work useful.

tiffanywei commented 8 years ago

+1

cmddavid commented 8 years ago

I've been using the code from #1527 for some time now, it works well. Only thing i had to change was one of the templates. The click event was missing in the theme i was using.