Emberjs how to disable Ember.Select?

I have a similar question on this

Emberjs - disable and enable TextField

therefore, it is disabled for the text field.

what about Ember.Select (drop down field)? I tried disabledBinding, but it does not work.

thanks!

+2
source share
1 answer

It does not work because disabled not defined in attributeBindings , see code .

The solution is to extend Ember.Select and add disabled to the * attributeBindings concatenated property, see http://jsfiddle.net/pangratz666/wTXfH/ :

Rudders

 <script type="text/x-handlebars" > {{view App.Select disabled="true"}} </script> 

Javascript

 App.Select = Ember.Select.extend({ attributeBindings: ['disabled'] });​ 

* The concatenated property means that overwriting this property in a subclass does not overwrite values, but extends existing ones from the superclass.

+6
source share

All Articles