目前,我正在使用{{view Ember.Select}}
方法轻松创建分组选择字段,如下所示:
{{view Ember.Select
name="car_manufacturer"
contentBinding="car_manufacturers"
optionGroupPath="country"
optionValuePath="content.val"
optionLabelPath="content.label"
}}
我的问题是,Ember.Select有没有办法创建一个选择字段,不包裹<option>
标签中的特定组名{ {1}}代码?
例如,生成这样的标记:
<optgroup>
答案 0 :(得分:0)
预先对数据进行排序,并将其发送到没有组路径的选项中。
carsByCountry: function(){
return this.sortBy('country');
}.property()