vendredi 27 février 2015

Can't add a layout to Ember.Select

I am trying to create a custom CSS dropdown which requires me to add a wrapper class to my Select view. I've attempted to add the code by reopening Ember.Select, but the behavior is not working as intended.


In my JS, I have this defined:



Ember.Select.reopen({
layout: Ember.Handlebars.compile("<div class='select-layout'>{{yield}}</div>")
});


In my template, I have:



{{view "select" content=model}}


However, my resulting HTML is:



<select id="ember257" class="ember-view ember-select">
<option id="ember270" class="ember-view" value="red">red</option>
<option id="ember273" class="ember-view" value="yellow">yellow</option>
<option id="ember276" class="ember-view" value="blue">blue</option>
</select>


I set up a JSFiddle for this which can be found here: http://ift.tt/1wvBOsZ


If there's a trick to this, please enlighten me.





Aucun commentaire:

Enregistrer un commentaire