X-Git-Url: http://git.roojs.org/?a=blobdiff_plain;f=Roo%2FViewPanel.js;h=7ca1e2ec45b37dc4b20c4b6f0825133b93974830;hb=refs%2Fheads%2Fwip_leon_T7094_logo_image_upload_in_boilerplate;hp=882cba3cc03c686e1def4156db98705e619fb728;hpb=4b4e521a0dc3ae4f4ad54dfd048a0cfdf84017d1;p=roojs1 diff --git a/Roo/ViewPanel.js b/Roo/ViewPanel.js index 882cba3cc0..7ca1e2ec45 100644 --- a/Roo/ViewPanel.js +++ b/Roo/ViewPanel.js @@ -17,15 +17,14 @@ * @param {Roo.grid.Grid} grid The grid for this panel * @param {String/Object} config A string to set only the panel's title, or a config object */ -Roo.ViewPanel = function(view, config){ - - +Roo.ViewPanel = function(el, config){ + this.wrapper = Roo.DomHelper.append(document.body, // wrapper for IE7 strict & safari scroll issue {tag: "div", cls: "x-layout-grid-wrapper x-layout-inactive-content"}, true); - this.wrapper.dom.appendChild(view.el.dom); + this.wrapper.dom.appendChild(el.dom); - Roo.GridPanel.superclass.constructor.call(this, this.wrapper, config); + Roo.ViewPanel.superclass.constructor.call(this, this.wrapper, config); if(this.toolbar){ this.toolbar.el.insertBefore(this.wrapper.dom.firstChild); @@ -33,22 +32,25 @@ Roo.ViewPanel = function(view, config){ // xtype created footer. - not sure if will work as we normally have to render first.. 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.container = this.wrapper.el; // this.getView().getFooterPanel(true); + this.footer.dataSource = this.view.store; this.footer = Roo.factory(this.footer, Roo); } + //??? create teh view??? - grid.monitorWindowResize = false; // turn off autosizing - grid.autoHeight = false; - grid.autoWidth = false; - this.grid = grid; - this.grid.getGridEl().replaceClass("x-layout-inactive-content", "x-layout-component-panel"); + //grid.monitorWindowResize = false; // turn off autosizing + //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, { +Roo.extend(Roo.ViewPanel, Roo.ContentPanel, { + + autoCreate : true, getId : function(){ - return this.grid.id; + return this.view.id; }, /** @@ -56,7 +58,7 @@ Roo.extend(Roo.GridPanel, Roo.ContentPanel, { * @return {Roo.grid.Grid} */ getGrid : function(){ - return this.grid; + return this.view; }, setSize : function(width, height){