In the next Layout , I add a CollectionView to display the SELECT list in onRender . Immediately after that, I use the ui hash to enable or disable all controls in the view. This does not work for SELECT generated using new App.View.Categories .
Should it? Or does the UI hash not work on Regions within 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') ); } });
source share