以下では、内に SELECT リストを表示するために をLayout
追加しています。その直後に、ui ハッシュを使用して、ビュー内のすべてのコントロールを有効または無効にしています。これは、 によって生成された SELECT では機能しません。CollectionView
onRender
new App.View.Categories
それはすべきですか?または、UI ハッシュはRegions
内で機能しませんLayout
か?
App.View.UploadFile = Backbone.Marionette.Layout.extend({
template: '#upload-file-template',
regions:{
category: 'td:nth-child(4)'
},
ui:{
inputs: 'textarea, select, .save'
},
onRender: function(){
this.category.show(
new App.View.Categories({
collection: App.collection.categories
}) // generates the SELECT list
);
console.log(this.ui.inputs); // Length 2. Missing select.
console.log(this.$('textarea, select, .save')); // Length 3
this.ui.inputs.prop(
'disabled', (this.model.get('upload_status')!='staged')
);
}
});