charlieridley / ember-typeahead

EmberJS autocomplete component using typeahead.js
MIT License
78 stars 17 forks source link

Cannot use more than one acomplete field #8

Open kristjanreinhold opened 10 years ago

kristjanreinhold commented 10 years ago

Got it working nicely on my first input , i changed ember select with it and got it styled. But on my formset, i've another autocomplete field. The second autocomplete field fetched the same data as first. (Same output on both of them.).

Route

controller.set('organizations', this.store.findAll('agents/organization')); controller.set('dbcountries', this.store.findAll('agents/geography/countries')); Models

var Organization = DS.Model.extend({ name: DS.attr('string'), });

Organization.FIXTURES = [ { id: 1, name: 'TU', }, { id: 2, name: 'TLU', } ];

'var Countries = DS.Model.extend({ code: DS.attr('string'), name: DS.attr('string') });

Countries.FIXTURES = [ { id: 1, code: 'est', name: 'Estonia' }, { id: 2, code: 'fin', name: 'Finland' } ]; HBS

This works properly

{{type-ahead data=organizations name="name" selection=field.myColour placeholder="Organizations" class="form-control"}}

This gives results of organization.

{{type-ahead data=dbcountries name="code" selection=field.country placeholder="Countries" class="form-control"}}

ninjatronic commented 10 years ago

Also experiencing this issue. All typeaheads on a page use the same data as the first typeahead.