The combination of Derik and Lasse answers leads me to a solution. onRender was what I was missing. The following is a summary for future readers.
Presentation structure of nested collections:
Collection of Collections --> Collection --> Item --> Collection --> Item --> ... etc.
CollectionOfCollections =
Backbone.Marionette.CollectionView.extend({ collection: myCollectionOfCollections, itemView: Collection });
Collection =
Backbone.Marionette.CollectionView.extend({ collection: myCollection, itemView: ItemView, tagName: 'optgroup',
Nested Collections with Backbone.Marionette
initialize: function(){ var xyz = this.model.get('abc'); this.collection = new Backbone.Collection.extend({}); }); onRender: function(){ this.$el.attr('label', this.model.get('name')); } }); });
ItemView =
ModalDropdownEntryView = TourView.extend({ model: myModel, template: '#myTemplate', tagName: 'option', });
source share