これはブートストラップの select コンポーネントではなく、select2 です(もっといいですね :)。
App.Select2SelectView = Ember.Select.extend({
prompt: 'Please select...',
classNames: ['input-xlarge'],
didInsertElement: function() {
Ember.run.scheduleOnce('afterRender', this, 'processChildElements');
},
processChildElements: function() {
this.$().select2({
// do here any configuration of the
// select2 component
});
},
willDestroyElement: function () {
this.$().select2("destroy");
}
})
そして、次のように使用します。
<div class="controls">
{{view App.Select2SelectView
id="mySelect"
contentBinding="App.staticData"
optionValuePath="content.id"
optionLabelPath="content.label"
selectionBinding="controller.selectedId"}}
</div>
select2コンポーネント用ですが、同じフックdidInsertElement
とブートストラップselectコンポーネントを使用できると思いwillDestroyElement
ます。
そして、ブートストラップの選択が本当に必要な場合は、おそらくこれがあなたのためのものです: https://github.com/emberjs-addons/ember-bootstrap
それが役に立てば幸い