emberx-select
emberx-select copied to clipboard
Doesn't work with RSVP hash
model(params){
return Ember.RSVP.hash({
realEstate: this.store.findRecord('realEstate', params.id, { reload: true }),
residentialComplexes: this.store.findAll('residentialComplex'),
});
},
{{#x-select value=model.realEstate.residentialComplexId as |xs|}}
<option></option>
{{#each model.residentialComplexes as |option|}}
{{#xs.option value=option.id}}{{option.name}}{{/xs.option}}
{{/each}}
{{/x-select}}
It populates, but doesn't select current value. model.realEstate.residentialComplexId exist and present as an option.
It doesn't work even if I change model.realEstate.residentialComplexId
manually later.
See #91.
{{#x-select value=model.realEstate.content as |xs|}}
<option></option>
{{#each model.residentialComplexes as |option|}}
{{#xs.option value=option}}{{option.name}}{{/xs.option}}
{{/each}}
{{/x-select}}
@scottwernervt nothing happens. I thought .content for relationships.
@meliborn I forgot to add action=(action (mut model.realEstate.residentialComplex))
. I created ember-twiddle at emberx-select: Doesn't work with RSVP hash #180.
I thought .content for relationships.
I am new to Ember and Javascript so I am not sure how model.content
is used. I believe it is a Ember.ObjectProxy.
@scottwernervt thanx, but you use belongsTo, when I have issue with simple attribute. As I understood, I can't use .content
with simple attributes.
I was still able to get it to work when removing belongsTo
and changing it to residentialComplexId: attr('string')
, check out the updated ember-twiddle. Note the changes to {{#x-select ...}
.