0
votes

I must be doing something wrong because I can't get the non-collection portion of the CompositeView to render with a specified template. No matter how I try to specify the template, it doesn't render as expected.

Per the docs at https://github.com/derickbailey/backbone.marionette/blob/master/docs/marionette.compositeview.md

I've tried providing a string that points at a template stored in a script tag, and a pre-compiled template as the template argument like so:

    Backbone.CompositeView.extend({
        template: _.template( "<div><span class='items'></span></div>" )
    });

Here's a live attempt in jsfiddle: http://jsfiddle.net/2PgrS/4/

1

1 Answers

4
votes

You never rendered your view.


    var view = new MyCompositeView({
        collection: collection
    });


    // render the view  
    view.render();


   view.$el.appendTo( "body" );

http://jsfiddle.net/derickbailey/XJLxv/1/