Ember Select Chosen Component?


#1

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 .


#2

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


#3

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}}

#4

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


#5

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


#6

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.