我将 BBB 与出色的 LayoutManager 一起用于视图。不幸的是,我找不到重新渲染特定子视图的方法。这是我的设置:
Home.Views.Layout = Backbone.Layout.extend({
template: "home/home",
el: "#main",
views: {
"#left-menu-container": new Home.Views.Leftmenu(),
"#searchbox": new Home.Views.Searchbox(),
"#content": new Home.Views.Content()
}
});
Home.HomeView = new Home.Views.Layout();
Home.HomeView.render();
Home.Views.AddEditPatient = Backbone.View.extend({
template: "......",
events: {
'click .dosomething': 'dosomething'
},
dosomething: function(){
// [dosomething]
// Only Render Sub-View, e.g. #content here...
}
});
我不想重新渲染整个布局,再次调用 Home.HomeView.render() 会发生什么,但是我如何才能在此设置中仅渲染子视图?