Roo.GridPanel = function(grid, config){
if (typeof(grid.grid) != 'undefined') {
config = grid;
grid = config.grid;
}
this.wrapper = Roo.DomHelper.append(document.body, {tag: "div", cls: "x-layout-grid-wrapper x-layout-inactive-content"}, true);
this.wrapper.dom.appendChild(grid.getGridEl().dom);
Roo.GridPanel.superclass.constructor.call(this, this.wrapper, config);
if(this.toolbar){
this.toolbar.el.insertBefore(this.wrapper.dom.firstChild);
}
if (this.footer && !this.footer.el && this.footer.xtype) {
this.footer.container = this.grid.getView().getFooterPanel(true);
this.footer.dataSource = this.grid.dataSource;
this.footer = Roo.factory(this.footer, Roo);
}
grid.monitorWindowResize = false; grid.autoHeight = false;
grid.autoWidth = false;
this.grid = grid;
this.grid.getGridEl().replaceClass("x-layout-inactive-content", "x-layout-component-panel");
};
Roo.extend(Roo.GridPanel, Roo.ContentPanel, {
getId : function(){
return this.grid.id;
},
getGrid : function(){
return this.grid;
},
setSize : function(width, height){
if(!this.ignoreResize(width, height)){
var grid = this.grid;
var size = this.adjustForComponents(width, height);
grid.getGridEl().setSize(size.width, size.height);
grid.autoSize();
}
},
beforeSlide : function(){
this.grid.getView().scroller.clip();
},
afterSlide : function(){
this.grid.getView().scroller.unclip();
},
destroy : function(){
this.grid.destroy();
delete this.grid;
Roo.GridPanel.superclass.destroy.call(this);
}
});