indrimuska / angular-selector

A native AngularJS directive that transform a simple <select> box into a full html select with typeahead.
http://indrimuska.github.io/angular-selector
MIT License
96 stars 36 forks source link

How to do multi select of group? #12

Closed donotdont closed 8 years ago

donotdont commented 8 years ago

How to do multi select of group that use one option? link this screenshot from 2016-01-16 13 18 42 HTML screenshot from 2016-01-16 13 21 22 JS screenshot from 2016-01-16 13 20 35

Code : http://embed.plnkr.co/pyADrWc9tWq6X9K94Sa1/

indrimuska commented 8 years ago

Hi @donotdont, I really can't understand where your problem is, I need more information to figure it out. Do you need help to select more than one value together? Could you please tell me the steps to get into your scenario?

donotdont commented 8 years ago

Hi @indrimuska , i mean select on once source option, ex. when i selected option on group number 1 => Current value as [0,1,2,3,4,5] in this picture, and i move to click select on group number 2. it's will not show option of selected on group number 1, Group number 2 show => Current value as [6,7,8,9,10, ... ].

indrimuska commented 8 years ago

I don't know if I've followed the correct steps, that's what I've done:

  1. I've selected all values from the FIRST select (label says "Group 1", but it's not the only one with this name)
  2. I've clicked on the button below "Add"
  3. I've changed my focus on the next select (label says "Group 2", and it's the only one!)
  4. Now I see NO options

So I analyzed your code and I've created this updated plunker. As I can see, you have two repeating groups of select, so I added a little number to each one before label name, respectively (1) at line 27 and (2) at line 54.

screenshot

After performing the same previous steps, I see that Group 2 now has label (1) Group 2, so the problem is in the method that returns the options list: comanationOption(item.comanation). I don't know why this method returns an array of null values, as you can see by printing: {{ comanationOption(item.comanation) | json }} - see this plunker

As you can see, this is not an issue of Angular Selector, so I'm going to close this.

donotdont commented 8 years ago

Thank you very much.