Ember Select Chosen Component?

Hi ,

Previously I am using Ember Chosen View .But in future ember js view will not be supported .So, I want to move select view to component .

I have used ember-chosen in past. Maybe you find it useful.

Hi I also referred it . But it is not working in my case …

>     {{ember-chosen
>       placeholder="Select Your Branches"
>       optionValuePath="name"
>       optionLabelPath="name"
>       content=remoteBranches
>       value=branch_name
>     }}

It is not updated in chosen select … @Yaroslav_Poliakov

If i use some other way , not working

> {{#ember-chosen value=branch_name}}
>       {{#each remoteBranches as |branches|}}
>             <option value={{branches.name}}>{{branches.name}}</option>
>       {{/each}}
> {{/ember-chosen}}

But if i hardquoted option value , it is working …

> {{#ember-chosen value=branch_name}}
>             <option value="testing1">testing1</option>
>            <option value="testing2">testing2</option>
> {{/ember-chosen}}

Could you also show your controller/component where addon used?

I like ember-cli-selectize. Example bloggr.exmer.com and click the edit button on a post.

I am biased because I created www.ember-power-select.com, but mi advice is:

  • if you want to use a “rich” select component, use one that isn’t a wrapper around a jquery library. They are doomed by design in fastboot.
  • If you want a native select, you can do it youself. The most basic usage is ~5 lines of code:
<select onchange={{action "myAction"}}>
  {{#each options as |opt index|}}
    <option value="{{index}}" selected={{if (eq opt selected) true}}>{{opt}}</option>
  {{/each}}
</select>

Having a prompt or groups might requite you to type 15LOC, but performance-wise nothing can beat that. I’m pretty sure there is some components out there that just wrap this code in a nicer API. Ember choosen seems to do something similar. https://github.com/cibernox/ember-power-select-with-fallback conditionally renders a native select depending on certain criteria.