lufthansa747
lufthansa747

Reputation: 2061

Backbone Layout Manager Nested Views not rendering

I am using Backbone and the Backbone Layout Manager plugin. I am trying to render a view which contains a nested view.

var ContentView = Backbone.Layout.extend({
    tagName: 'div',
    className: 'container',

    views: {
        "contactList": new ContactListView({
                            collection: new Contacts()
                        })
    },

    changeContactSelection: function(one){
        console.log('dsdssdsdssd');
        console.log(one);
    },

    initialize: function (){
        this.listenTo(this.getView("contactList"), "change:selectedContact", this.changeContactSelection);
    }
});

This code runs with no errors but nothing is rendered on the screen. I have also tried adding

beforeRender: function (){
    this.insertView("contactList");
}

but this causes the following error

Uncaught Error: The argument associated with selector 'contactList' is defined and a View. Set manage property to true for Backbone.View instances

However, ContactListView is a Backbone.Layout, not a Backbone.View.

Upvotes: 0

Views: 646

Answers (0)

Related Questions