我使用manage设置为true的Layoutmanager
Backbone.Layout.configure({
manage: true这破坏了Backgrid的渲染。
当manage设置为false时,表将正确呈现,但如果将manage设置为true,则表不会完全呈现(没有表头或表体),而只呈现<table class="backgrid"></table>。
发布于 2015-03-25 14:01:34
我知道这是一个老问题,但这是因为LayoutManager和Backgrid都使用“呈现”函数。当manage设置为true时,LayoutManager用自己的render函数覆盖Backgrid的呈现函数。
我的方法是创建一个扩展Backgrid的新视图,并直接调用它的呈现函数。
var myGrid = Backgrid.Grid.extend({
manage:true,
initialize: function(options) {
Backgrid.Grid.prototype.initialize.call(this,options));
this.renderGrid();
},
renderGrid: function() {
Backgrid.Grid.prototype.render.call(this);
return this;
}
});
https://stackoverflow.com/questions/18403467
复制相似问题