4 * @extends Roo.ContentPanel
5 * @parent Roo.BorderLayout Roo.LayoutDialog builder
7 * Create a new GridPanel.
8 * @cfg {Roo.grid.Grid} grid The grid for this panel
10 Roo.GridPanel = function(grid, config){
13 if (typeof(grid.grid) != 'undefined') {
17 this.wrapper = Roo.DomHelper.append(document.body, // wrapper for IE7 strict & safari scroll issue
18 {tag: "div", cls: "x-layout-grid-wrapper x-layout-inactive-content"}, true);
20 this.wrapper.dom.appendChild(grid.getGridEl().dom);
22 Roo.GridPanel.superclass.constructor.call(this, this.wrapper, config);
25 this.toolbar.el.insertBefore(this.wrapper.dom.firstChild);
27 // xtype created footer. - not sure if will work as we normally have to render first..
28 if (this.footer && !this.footer.el && this.footer.xtype) {
30 this.footer.container = this.grid.getView().getFooterPanel(true);
31 this.footer.dataSource = this.grid.dataSource;
32 this.footer = Roo.factory(this.footer, Roo);
36 grid.monitorWindowResize = false; // turn off autosizing
37 grid.autoHeight = false;
38 grid.autoWidth = false;
40 this.grid.getGridEl().replaceClass("x-layout-inactive-content", "x-layout-component-panel");
43 Roo.extend(Roo.GridPanel, Roo.ContentPanel, {
49 * Returns the grid for this panel
50 * @return {Roo.grid.Grid}
56 setSize : function(width, height){
57 if(!this.ignoreResize(width, height)){
59 var size = this.adjustForComponents(width, height);
60 grid.getGridEl().setSize(size.width, size.height);
65 beforeSlide : function(){
66 this.grid.getView().scroller.clip();
69 afterSlide : function(){
70 this.grid.getView().scroller.unclip();
76 Roo.GridPanel.superclass.destroy.call(this);