2013-08-28 3 views
1

Вот пример кода из github диспетчера макета. Пользовательский рендер для представления не получает/не останавливается на точке разрыва. Что происходит.Менеджмент макета макинтоша - Render not called

// Create a Content view to be used with the Layout below. 
    var ContentView = Backbone.Layout.extend({ 
     template: "#content" 
    }); 

    // Create a new Layout with a sub view for content. 
    var layout = new Backbone.Layout({ 
     template: "#layout", 

     // This will place the contents of the Content View into the main 
     // Layout's <p></p>. 
     views: { 
     // Appending a new content view using the array syntax 
     p: new ContentView({ 
      // Custom render function that reverses everything. 
      render: function(template, context) { 
      return template(context).split("").reverse().join(""); 
      } 
     }) 
     } 
    }); 

    // Attach the Layout to the main container. 
    layout.$el.appendTo(".main"); 

    // Render the Layout. 
    layout.render(); 
+0

Можете ли вы вставить демо вместе @ http://jsfiddle.net? –

ответ

1

Об этом ответил Гитуб, когда я опубликовал эту проблему. это должно быть layout.renderTemplate()