MOVED Roo/TreePanel.js to Roo/panel/TreePanel.js
authorleon <leon@roojs.com>
Mon, 1 Aug 2022 07:05:53 +0000 (15:05 +0800)
committerleon <leon@roojs.com>
Mon, 1 Aug 2022 07:05:53 +0000 (15:05 +0800)
Roo/TreePanel.js
Roo/panel/Tree.js

Roo/panel/Tree.js [new file with mode: 0644]

diff --git a/Roo/panel/Tree.js b/Roo/panel/Tree.js
new file mode 100644 (file)
index 0000000..ac207c4
--- /dev/null
@@ -0,0 +1,61 @@
+
+
+
+/**
+ * @class Roo.panel.Tree
+ * @extends Roo.panel.Content
+ * @parent Roo.BorderLayout Roo.LayoutDialog builder
+ * Treepanel component
+ * 
+ * @constructor
+ * Create a new TreePanel. - defaults to fit/scoll contents.
+ * @param {String/Object} config A string to set only the panel's title, or a config object
+ */
+Roo.panel.Tree = function(config){
+    var el = config.el;
+    var tree = config.tree;
+    delete config.tree; 
+    delete config.el; // hopefull!
+    
+    // wrapper for IE7 strict & safari scroll issue
+    
+    var treeEl = el.createChild();
+    config.resizeEl = treeEl;
+    
+    
+    
+    Roo.panel.Tree.superclass.constructor.call(this, el, config);
+    this.tree = new Roo.tree.panel.Tree(treeEl , tree);
+    //console.log(tree);
+    this.on('activate', function()
+    {
+        if (this.tree.rendered) {
+            return;
+        }
+        //console.log('render tree');
+        this.tree.render();
+    });
+    // this should not be needed.. - it's actually the 'el' that resizes?
+    // actuall it breaks the containerScroll - dragging nodes auto scroll at top
+    
+    //this.on('resize',  function (cp, w, h) {
+    //        this.tree.innerCt.setWidth(w);
+    //        this.tree.innerCt.setHeight(h);
+    //        //this.tree.innerCt.setStyle('overflow-y', 'auto');
+    //});
+
+        
+    
+};
+
+Roo.extend(Roo.panel.Tree, Roo.panel.Content, {   
+    fitToFrame : true,
+    autoScroll : true,
+    /*
+     * @cfg {Roo.tree.panel.Tree} tree [required] The tree TreePanel, with config etc.
+     */
+    tree : false
+
+});