iStefo / ember-select-2

DEPRECATED IN FAVOR OF https://github.com/cibernox/ember-power-select
MIT License
143 stars 119 forks source link

hasMany value show a blank rectangle #107

Closed GCorbel closed 9 years ago

GCorbel commented 9 years ago

Hello,

I have this simple selector :

{{select-2
    content=skills
    value=choosedSkills
    multiple=true
}}

With this controller :

export default Ember.Controller.extend
  choosedSkills: (->
    @model.get('skills')
  ).property('choosedSkills')
  skills: (->
    @store.findAll 'skill'
  ).property('skills')

I think all skills of the model should be assigned but I have this result :

capture du 2015-06-27 13 53 48

When I try this :

export default Ember.Controller.extend
  choosedSkills: (->
    [{name: 'test', description: 'test'}]
  ).property('choosedSkills')
  skills: (->
    @store.findAll 'skill'
  ).property('skills')

It works.

Does ember-select-2 works with hasMany associations ?

abobwhite commented 9 years ago

@GCorbel I created an issue for this last week with the same issue: #105. I haven't heard anything back but looking through the code, it appears that ember-select-2 does not currently support hasMany because it setting the array instead of adding/removing from it which throws a console error seen in #105. If you open your console and are seeing this read-only error, you should go ahead and add your info to #105 and close this issue.

vst commented 9 years ago

Confirmed. Furthermore, if the value is a property of a DS object, the two way binding is broken, too.

GCorbel commented 9 years ago

It works now.

abobwhite commented 9 years ago

How can it work now? There have been no commits to this repo since before you even opened this issue......

@GCorbel

GCorbel commented 9 years ago

I saw. It maybe because of an update of ember...

yaapis commented 9 years ago

Same issue with ember 1.13.3 and ember data 1.13.5

angouleme commented 9 years ago

for everyone getting similar error (select2 with multiple option and hasMany), in last comment of this issue: https://github.com/iStefo/ember-select-2/issues/105 I've posted a workaround that worked quite well for me.