fix #7318 - rename upload cropbox and panel tree
[roojs1] / Roo / ViewPanel.js
index 95491c0..dfc11c9 100644 (file)
  */
 
 /**
- * @class Roo.GridPanel
- * @extends Roo.ContentPanel
+ * @class Roo.ViewPanel
+ * @extends Roo.panel.Content
  * @constructor
- * Create a new GridPanel.
+ * Create a new ViewPanel.
  * @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.ViewPanel.superclass.constructor.call(this, this.wrapper, config);
     
@@ -34,21 +33,24 @@ Roo.ViewPanel = function(view, config){
     if (this.footer && !this.footer.el && this.footer.xtype) {
         
         this.footer.container = this.wrapper.el; // this.getView().getFooterPanel(true);
-        this.footer.dataSource = this.grid.dataSource;
+        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.panel.Content, {
+    
+    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){
@@ -79,6 +81,6 @@ Roo.extend(Roo.GridPanel, Roo.ContentPanel, {
     destroy : function(){
         this.grid.destroy();
         delete this.grid;
-        Roo.GridPanel.superclass.destroy.call(this); 
+        Roo.panel.Grid.superclass.destroy.call(this); 
     }
 });
\ No newline at end of file