对于这个问题我有一个类似的问题
Emberjs - Disable and Enable TextField
因此,对于文本字段,它是disabledBinding。
那么Ember.Select (下拉字段)呢?我尝试过disabledBinding,但它不起作用。
谢谢!
发布于 2012-07-13 02:12:46
它无法工作,因为attributeBindings中没有定义disabled,请参阅code。
一种解决方案是扩展Ember.Select并将disabled添加到连接属性* attributeBindings中,请参见http://jsfiddle.net/pangratz666/wTXfH/
Handlebar
<script type="text/x-handlebars" >
{{view App.Select disabled="true"}}
</script>JavaScript
App.Select = Ember.Select.extend({
attributeBindings: ['disabled']
});*连接属性意味着,覆盖子类中的this属性不会覆盖值,而是扩展超类中的现有值。
https://stackoverflow.com/questions/11457206
复制相似问题