1aa7306eaba4f407ff39c80a5e7d3b1616229aa5
[roojs1] / Roo / ContentPanel.js
1 /*
2  * Based on:
3  * Ext JS Library 1.1.1
4  * Copyright(c) 2006-2007, Ext JS, LLC.
5  *
6  * Originally Released Under LGPL - original licence link has changed is not relivant.
7  *
8  * Fork - LGPL
9  * <script type="text/javascript">
10  */
11 /**
12  * @class Roo.ContentPanel
13  * @extends Roo.util.Observable
14  * @children Roo.form.Form Roo.JsonView Roo.View
15  * A basic ContentPanel element.
16  * @cfg {Boolean}   fitToFrame    True for this panel to adjust its size to fit when the region resizes  (defaults to false)
17  * @cfg {Boolean}   fitContainer   When using {@link #fitToFrame} and {@link #resizeEl}, you can also fit the parent container  (defaults to false)
18  * @cfg {Boolean|Object} autoCreate True to auto generate the DOM element for this panel, or a {@link Roo.DomHelper} config of the element to create
19  * @cfg {Boolean}   closable      True if the panel can be closed/removed
20  * @cfg {Boolean}   background    True if the panel should not be activated when it is added (defaults to false)
21  * @cfg {String|HTMLElement|Element} resizeEl An element to resize if {@link #fitToFrame} is true (instead of this panel's element)
22  * @cfg {Toolbar}   toolbar       A toolbar for this panel
23  * @cfg {Boolean} autoScroll    True to scroll overflow in this panel (use with {@link #fitToFrame})
24  * @cfg {String} title          The title for this panel
25  * @cfg {Array} adjustments     Values to <b>add</b> to the width/height when doing a {@link #fitToFrame} (default is [0, 0])
26  * @cfg {String} url            Calls {@link #setUrl} with this value
27  * @cfg {String} region [required]   (center|north|south|east|west) which region to put this panel on (when used with xtype constructors)
28  * @cfg {String|Object} params  When used with {@link #url}, calls {@link #setUrl} with this value
29  * @cfg {Boolean} loadOnce      When used with {@link #url}, calls {@link #setUrl} with this value
30  * @cfg {String}    content        Raw content to fill content panel with (uses setContent on construction.)
31  * @cfg {String}    style  Extra style to add to the content panel 
32
33  * @constructor
34  * Create a new ContentPanel.
35  * @param {String/HTMLElement/Roo.Element} el The container element for this panel
36  * @param {String/Object} config A string to set only the title or a config object
37  * @param {String} content (optional) Set the HTML content for this panel
38  * @param {String} region (optional) Used by xtype constructors to add to regions. (values center,east,west,south,north)
39  */
40 Roo.ContentPanel = function(el, config, content){
41     
42      
43     /*
44     if(el.autoCreate || el.xtype){ // xtype is available if this is called from factory
45         config = el;
46         el = Roo.id();
47     }
48     if (config && config.parentLayout) { 
49         el = config.parentLayout.el.createChild(); 
50     }
51     */
52     if(el.autoCreate){ // xtype is available if this is called from factory
53         config = el;
54         el = Roo.id();
55     }
56     this.el = Roo.get(el);
57     if(!this.el && config && config.autoCreate){
58         if(typeof config.autoCreate == "object"){
59             if(!config.autoCreate.id){
60                 config.autoCreate.id = config.id||el;
61             }
62             this.el = Roo.DomHelper.append(document.body,
63                         config.autoCreate, true);
64         }else{
65             this.el = Roo.DomHelper.append(document.body,
66                         {tag: "div", cls: "x-layout-inactive-content", id: config.id||el}, true);
67         }
68     }
69     
70     
71     this.closable = false;
72     this.loaded = false;
73     this.active = false;
74     if(typeof config == "string"){
75         this.title = config;
76     }else{
77         Roo.apply(this, config);
78     }
79     
80     if (this.toolbar && !this.toolbar.el && this.toolbar.xtype) {
81         this.wrapEl = this.el.wrap();
82         this.toolbar.container = this.el.insertSibling(false, 'before');
83         this.toolbar = new Roo.Toolbar(this.toolbar);
84     }
85     
86     // xtype created footer. - not sure if will work as we normally have to render first..
87     if (this.footer && !this.footer.el && this.footer.xtype) {
88         if (!this.wrapEl) {
89             this.wrapEl = this.el.wrap();
90         }
91     
92         this.footer.container = this.wrapEl.createChild();
93          
94         this.footer = Roo.factory(this.footer, Roo);
95         
96     }
97     
98     if(this.resizeEl){
99         this.resizeEl = Roo.get(this.resizeEl, true);
100     }else{
101         this.resizeEl = this.el;
102     }
103     // handle view.xtype
104     
105  
106     
107     
108     this.addEvents({
109         /**
110          * @event activate
111          * Fires when this panel is activated. 
112          * @param {Roo.ContentPanel} this
113          */
114         "activate" : true,
115         /**
116          * @event deactivate
117          * Fires when this panel is activated. 
118          * @param {Roo.ContentPanel} this
119          */
120         "deactivate" : true,
121
122         /**
123          * @event resize
124          * Fires when this panel is resized if fitToFrame is true.
125          * @param {Roo.ContentPanel} this
126          * @param {Number} width The width after any component adjustments
127          * @param {Number} height The height after any component adjustments
128          */
129         "resize" : true,
130         
131          /**
132          * @event render
133          * Fires when this tab is created
134          * @param {Roo.ContentPanel} this
135          */
136         "render" : true
137          
138         
139     });
140     
141
142     
143     
144     if(this.autoScroll){
145         this.resizeEl.setStyle("overflow", "auto");
146     } else {
147         // fix randome scrolling
148         this.el.on('scroll', function() {
149             Roo.log('fix random scolling');
150             this.scrollTo('top',0); 
151         });
152     }
153     content = content || this.content;
154     if(content){
155         this.setContent(content);
156     }
157     if(config && config.url){
158         this.setUrl(this.url, this.params, this.loadOnce);
159     }
160     
161     
162     
163     Roo.ContentPanel.superclass.constructor.call(this);
164     
165     if (this.view && typeof(this.view.xtype) != 'undefined') {
166         this.view.el = this.el.appendChild(document.createElement("div"));
167         this.view = Roo.factory(this.view); 
168         this.view.render  &&  this.view.render(false, '');  
169     }
170     
171     
172     this.fireEvent('render', this);
173 };
174
175 Roo.extend(Roo.ContentPanel, Roo.util.Observable, {
176     tabTip:'',
177     setRegion : function(region){
178         this.region = region;
179         if(region){
180            this.el.replaceClass("x-layout-inactive-content", "x-layout-active-content");
181         }else{
182            this.el.replaceClass("x-layout-active-content", "x-layout-inactive-content");
183         } 
184     },
185     
186     /**
187      * Returns the toolbar for this Panel if one was configured. 
188      * @return {Roo.Toolbar} 
189      */
190     getToolbar : function(){
191         return this.toolbar;
192     },
193     
194     setActiveState : function(active){
195         this.active = active;
196         if(!active){
197             this.fireEvent("deactivate", this);
198         }else{
199             this.fireEvent("activate", this);
200         }
201     },
202     /**
203      * Updates this panel's element
204      * @param {String} content The new content
205      * @param {Boolean} loadScripts (optional) true to look for and process scripts
206     */
207     setContent : function(content, loadScripts){
208         this.el.update(content, loadScripts);
209     },
210
211     ignoreResize : function(w, h){
212         if(this.lastSize && this.lastSize.width == w && this.lastSize.height == h){
213             return true;
214         }else{
215             this.lastSize = {width: w, height: h};
216             return false;
217         }
218     },
219     /**
220      * Get the {@link Roo.UpdateManager} for this panel. Enables you to perform Ajax updates.
221      * @return {Roo.UpdateManager} The UpdateManager
222      */
223     getUpdateManager : function(){
224         return this.el.getUpdateManager();
225     },
226      /**
227      * Loads this content panel immediately with content from XHR. Note: to delay loading until the panel is activated, use {@link #setUrl}.
228      * @param {Object/String/Function} url The url for this request or a function to call to get the url or a config object containing any of the following options:
229 <pre><code>
230 panel.load({
231     url: "your-url.php",
232     params: {param1: "foo", param2: "bar"}, // or a URL encoded string
233     callback: yourFunction,
234     scope: yourObject, //(optional scope)
235     discardUrl: false,
236     nocache: false,
237     text: "Loading...",
238     timeout: 30,
239     scripts: false
240 });
241 </code></pre>
242      * The only required property is <i>url</i>. The optional properties <i>nocache</i>, <i>text</i> and <i>scripts</i>
243      * are shorthand for <i>disableCaching</i>, <i>indicatorText</i> and <i>loadScripts</i> and are used to set their associated property on this panel UpdateManager instance.
244      * @param {String/Object} params (optional) The parameters to pass as either a URL encoded string "param1=1&amp;param2=2" or an object {param1: 1, param2: 2}
245      * @param {Function} callback (optional) Callback when transaction is complete -- called with signature (oElement, bSuccess, oResponse)
246      * @param {Boolean} discardUrl (optional) By default when you execute an update the defaultUrl is changed to the last used URL. If true, it will not store the URL.
247      * @return {Roo.ContentPanel} this
248      */
249     load : function(){
250         var um = this.el.getUpdateManager();
251         um.update.apply(um, arguments);
252         return this;
253     },
254
255
256     /**
257      * Set a URL to be used to load the content for this panel. When this panel is activated, the content will be loaded from that URL.
258      * @param {String/Function} url The URL to load the content from or a function to call to get the URL
259      * @param {String/Object} params (optional) The string params for the update call or an object of the params. See {@link Roo.UpdateManager#update} for more details. (Defaults to null)
260      * @param {Boolean} loadOnce (optional) Whether to only load the content once. If this is false it makes the Ajax call every time this panel is activated. (Defaults to false)
261      * @return {Roo.UpdateManager} The UpdateManager
262      */
263     setUrl : function(url, params, loadOnce){
264         if(this.refreshDelegate){
265             this.removeListener("activate", this.refreshDelegate);
266         }
267         this.refreshDelegate = this._handleRefresh.createDelegate(this, [url, params, loadOnce]);
268         this.on("activate", this.refreshDelegate);
269         return this.el.getUpdateManager();
270     },
271     
272     _handleRefresh : function(url, params, loadOnce){
273         if(!loadOnce || !this.loaded){
274             var updater = this.el.getUpdateManager();
275             updater.update(url, params, this._setLoaded.createDelegate(this));
276         }
277     },
278     
279     _setLoaded : function(){
280         this.loaded = true;
281     }, 
282     
283     /**
284      * Returns this panel's id
285      * @return {String} 
286      */
287     getId : function(){
288         return this.el.id;
289     },
290     
291     /** 
292      * Returns this panel's element - used by regiosn to add.
293      * @return {Roo.Element} 
294      */
295     getEl : function(){
296         return this.wrapEl || this.el;
297     },
298     
299     adjustForComponents : function(width, height)
300     {
301         //Roo.log('adjustForComponents ');
302         if(this.resizeEl != this.el){
303             width -= this.el.getFrameWidth('lr');
304             height -= this.el.getFrameWidth('tb');
305         }
306         if(this.toolbar){
307             var te = this.toolbar.getEl();
308             height -= te.getHeight();
309             te.setWidth(width);
310         }
311         if(this.footer){
312             var te = this.footer.getEl();
313             //Roo.log("footer:" + te.getHeight());
314             
315             height -= te.getHeight();
316             te.setWidth(width);
317         }
318         
319         
320         if(this.adjustments){
321             width += this.adjustments[0];
322             height += this.adjustments[1];
323         }
324         return {"width": width, "height": height};
325     },
326     
327     setSize : function(width, height){
328         if(this.fitToFrame && !this.ignoreResize(width, height)){
329             if(this.fitContainer && this.resizeEl != this.el){
330                 this.el.setSize(width, height);
331             }
332             var size = this.adjustForComponents(width, height);
333             this.resizeEl.setSize(this.autoWidth ? "auto" : size.width, this.autoHeight ? "auto" : size.height);
334             this.fireEvent('resize', this, size.width, size.height);
335         }
336     },
337     
338     /**
339      * Returns this panel's title
340      * @return {String} 
341      */
342     getTitle : function(){
343         return this.title;
344     },
345     
346     /**
347      * Set this panel's title
348      * @param {String} title
349      */
350     setTitle : function(title){
351         this.title = title;
352         if(this.region){
353             this.region.updatePanelTitle(this, title);
354         }
355     },
356     
357     /**
358      * Returns true is this panel was configured to be closable
359      * @return {Boolean} 
360      */
361     isClosable : function(){
362         return this.closable;
363     },
364     
365     beforeSlide : function(){
366         this.el.clip();
367         this.resizeEl.clip();
368     },
369     
370     afterSlide : function(){
371         this.el.unclip();
372         this.resizeEl.unclip();
373     },
374     
375     /**
376      *   Force a content refresh from the URL specified in the {@link #setUrl} method.
377      *   Will fail silently if the {@link #setUrl} method has not been called.
378      *   This does not activate the panel, just updates its content.
379      */
380     refresh : function(){
381         if(this.refreshDelegate){
382            this.loaded = false;
383            this.refreshDelegate();
384         }
385     },
386     
387     /**
388      * Destroys this panel
389      */
390     destroy : function(){
391         this.el.removeAllListeners();
392         var tempEl = document.createElement("span");
393         tempEl.appendChild(this.el.dom);
394         tempEl.innerHTML = "";
395         this.el.remove();
396         this.el = null;
397     },
398     
399     /**
400      * form - if the content panel contains a form - this is a reference to it.
401      * @type {Roo.form.Form}
402      */
403     form : false,
404     /**
405      * view - if the content panel contains a view (Roo.DatePicker / Roo.View / Roo.JsonView)
406      *    This contains a reference to it.
407      * @type {Roo.View}
408      */
409     view : false,
410     
411       /**
412      * Adds a xtype elements to the panel - currently only supports Forms, View, JsonView.
413      * <pre><code>
414
415 layout.addxtype({
416        xtype : 'Form',
417        items: [ .... ]
418    }
419 );
420
421 </code></pre>
422      * @param {Object} cfg Xtype definition of item to add.
423      */
424     
425     addxtype : function(cfg) {
426         // add form..
427         if (cfg.xtype.match(/^Form$/)) {
428             
429             var el;
430             //if (this.footer) {
431             //    el = this.footer.container.insertSibling(false, 'before');
432             //} else {
433                 el = this.el.createChild();
434             //}
435
436             this.form = new  Roo.form.Form(cfg);
437             
438             
439             if ( this.form.allItems.length) {
440                 this.form.render(el.dom);
441             }
442             return this.form;
443         }
444         // should only have one of theses..
445         if ([ 'View', 'JsonView', 'DatePicker'].indexOf(cfg.xtype) > -1) {
446             // views.. should not be just added - used named prop 'view''
447             
448             cfg.el = this.el.appendChild(document.createElement("div"));
449             // factory?
450             
451             var ret = new Roo.factory(cfg);
452              
453              ret.render && ret.render(false, ''); // render blank..
454             this.view = ret;
455             return ret;
456         }
457         return false;
458     }
459 });
460
461 /**
462  * @class Roo.GridPanel
463  * @extends Roo.ContentPanel
464  * @constructor
465  * Create a new GridPanel.
466  * @param {Roo.grid.Grid} grid The grid for this panel
467  * @param {String/Object} config A string to set only the panel's title, or a config object
468  */
469 Roo.GridPanel = function(grid, config){
470     
471   
472     this.wrapper = Roo.DomHelper.append(document.body, // wrapper for IE7 strict & safari scroll issue
473         {tag: "div", cls: "x-layout-grid-wrapper x-layout-inactive-content"}, true);
474         
475     this.wrapper.dom.appendChild(grid.getGridEl().dom);
476     
477     Roo.GridPanel.superclass.constructor.call(this, this.wrapper, config);
478     
479     if(this.toolbar){
480         this.toolbar.el.insertBefore(this.wrapper.dom.firstChild);
481     }
482     // xtype created footer. - not sure if will work as we normally have to render first..
483     if (this.footer && !this.footer.el && this.footer.xtype) {
484         
485         this.footer.container = this.grid.getView().getFooterPanel(true);
486         this.footer.dataSource = this.grid.dataSource;
487         this.footer = Roo.factory(this.footer, Roo);
488         
489     }
490     
491     grid.monitorWindowResize = false; // turn off autosizing
492     grid.autoHeight = false;
493     grid.autoWidth = false;
494     this.grid = grid;
495     this.grid.getGridEl().replaceClass("x-layout-inactive-content", "x-layout-component-panel");
496 };
497
498 Roo.extend(Roo.GridPanel, Roo.ContentPanel, {
499     getId : function(){
500         return this.grid.id;
501     },
502     
503     /**
504      * Returns the grid for this panel
505      * @return {Roo.grid.Grid} 
506      */
507     getGrid : function(){
508         return this.grid;    
509     },
510     
511     setSize : function(width, height){
512         if(!this.ignoreResize(width, height)){
513             var grid = this.grid;
514             var size = this.adjustForComponents(width, height);
515             grid.getGridEl().setSize(size.width, size.height);
516             grid.autoSize();
517         }
518     },
519     
520     beforeSlide : function(){
521         this.grid.getView().scroller.clip();
522     },
523     
524     afterSlide : function(){
525         this.grid.getView().scroller.unclip();
526     },
527     
528     destroy : function(){
529         this.grid.destroy();
530         delete this.grid;
531         Roo.GridPanel.superclass.destroy.call(this); 
532     }
533 });
534
535
536 /**
537  * @class Roo.NestedLayoutPanel
538  * @extends Roo.ContentPanel
539  * @constructor
540  * Create a new NestedLayoutPanel.
541  * 
542  * 
543  * @param {Roo.BorderLayout} layout [required] The layout for this panel
544  * @param {String/Object} config A string to set only the title or a config object
545  */
546 Roo.NestedLayoutPanel = function(layout, config)
547 {
548     // construct with only one argument..
549     /* FIXME - implement nicer consturctors
550     if (layout.layout) {
551         config = layout;
552         layout = config.layout;
553         delete config.layout;
554     }
555     if (layout.xtype && !layout.getEl) {
556         // then layout needs constructing..
557         layout = Roo.factory(layout, Roo);
558     }
559     */
560     
561     
562     Roo.NestedLayoutPanel.superclass.constructor.call(this, layout.getEl(), config);
563     
564     layout.monitorWindowResize = false; // turn off autosizing
565     this.layout = layout;
566     this.layout.getEl().addClass("x-layout-nested-layout");
567     
568     
569     
570     
571 };
572
573 Roo.extend(Roo.NestedLayoutPanel, Roo.ContentPanel, {
574
575     setSize : function(width, height){
576         if(!this.ignoreResize(width, height)){
577             var size = this.adjustForComponents(width, height);
578             var el = this.layout.getEl();
579             el.setSize(size.width, size.height);
580             var touch = el.dom.offsetWidth;
581             this.layout.layout();
582             // ie requires a double layout on the first pass
583             if(Roo.isIE && !this.initialized){
584                 this.initialized = true;
585                 this.layout.layout();
586             }
587         }
588     },
589     
590     // activate all subpanels if not currently active..
591     
592     setActiveState : function(active){
593         this.active = active;
594         if(!active){
595             this.fireEvent("deactivate", this);
596             return;
597         }
598         
599         this.fireEvent("activate", this);
600         // not sure if this should happen before or after..
601         if (!this.layout) {
602             return; // should not happen..
603         }
604         var reg = false;
605         for (var r in this.layout.regions) {
606             reg = this.layout.getRegion(r);
607             if (reg.getActivePanel()) {
608                 //reg.showPanel(reg.getActivePanel()); // force it to activate.. 
609                 reg.setActivePanel(reg.getActivePanel());
610                 continue;
611             }
612             if (!reg.panels.length) {
613                 continue;
614             }
615             reg.showPanel(reg.getPanel(0));
616         }
617         
618         
619         
620         
621     },
622     
623     /**
624      * Returns the nested BorderLayout for this panel
625      * @return {Roo.BorderLayout} 
626      */
627     getLayout : function(){
628         return this.layout;
629     },
630     
631      /**
632      * Adds a xtype elements to the layout of the nested panel
633      * <pre><code>
634
635 panel.addxtype({
636        xtype : 'ContentPanel',
637        region: 'west',
638        items: [ .... ]
639    }
640 );
641
642 panel.addxtype({
643         xtype : 'NestedLayoutPanel',
644         region: 'west',
645         layout: {
646            center: { },
647            west: { }   
648         },
649         items : [ ... list of content panels or nested layout panels.. ]
650    }
651 );
652 </code></pre>
653      * @param {Object} cfg Xtype definition of item to add.
654      */
655     addxtype : function(cfg) {
656         return this.layout.addxtype(cfg);
657     
658     }
659 });
660
661 Roo.ScrollPanel = function(el, config, content){
662     config = config || {};
663     config.fitToFrame = true;
664     Roo.ScrollPanel.superclass.constructor.call(this, el, config, content);
665     
666     this.el.dom.style.overflow = "hidden";
667     var wrap = this.el.wrap({cls: "x-scroller x-layout-inactive-content"});
668     this.el.removeClass("x-layout-inactive-content");
669     this.el.on("mousewheel", this.onWheel, this);
670
671     var up = wrap.createChild({cls: "x-scroller-up", html: "&#160;"}, this.el.dom);
672     var down = wrap.createChild({cls: "x-scroller-down", html: "&#160;"});
673     up.unselectable(); down.unselectable();
674     up.on("click", this.scrollUp, this);
675     down.on("click", this.scrollDown, this);
676     up.addClassOnOver("x-scroller-btn-over");
677     down.addClassOnOver("x-scroller-btn-over");
678     up.addClassOnClick("x-scroller-btn-click");
679     down.addClassOnClick("x-scroller-btn-click");
680     this.adjustments = [0, -(up.getHeight() + down.getHeight())];
681
682     this.resizeEl = this.el;
683     this.el = wrap; this.up = up; this.down = down;
684 };
685
686 Roo.extend(Roo.ScrollPanel, Roo.ContentPanel, {
687     increment : 100,
688     wheelIncrement : 5,
689     scrollUp : function(){
690         this.resizeEl.scroll("up", this.increment, {callback: this.afterScroll, scope: this});
691     },
692
693     scrollDown : function(){
694         this.resizeEl.scroll("down", this.increment, {callback: this.afterScroll, scope: this});
695     },
696
697     afterScroll : function(){
698         var el = this.resizeEl;
699         var t = el.dom.scrollTop, h = el.dom.scrollHeight, ch = el.dom.clientHeight;
700         this.up[t == 0 ? "addClass" : "removeClass"]("x-scroller-btn-disabled");
701         this.down[h - t <= ch ? "addClass" : "removeClass"]("x-scroller-btn-disabled");
702     },
703
704     setSize : function(){
705         Roo.ScrollPanel.superclass.setSize.apply(this, arguments);
706         this.afterScroll();
707     },
708
709     onWheel : function(e){
710         var d = e.getWheelDelta();
711         this.resizeEl.dom.scrollTop -= (d*this.wheelIncrement);
712         this.afterScroll();
713         e.stopEvent();
714     },
715
716     setContent : function(content, loadScripts){
717         this.resizeEl.update(content, loadScripts);
718     }
719
720 });
721
722
723
724 /**
725  * @class Roo.TreePanel
726  * @extends Roo.ContentPanel
727  * Treepanel component
728  * 
729  * @constructor
730  * Create a new TreePanel. - defaults to fit/scoll contents.
731  * @param {String/Object} config A string to set only the panel's title, or a config object
732  */
733 Roo.TreePanel = function(config){
734     var el = config.el;
735     var tree = config.tree;
736     delete config.tree; 
737     delete config.el; // hopefull!
738     
739     // wrapper for IE7 strict & safari scroll issue
740     
741     var treeEl = el.createChild();
742     config.resizeEl = treeEl;
743     
744     
745     
746     Roo.TreePanel.superclass.constructor.call(this, el, config);
747  
748  
749     this.tree = new Roo.tree.TreePanel(treeEl , tree);
750     //console.log(tree);
751     this.on('activate', function()
752     {
753         if (this.tree.rendered) {
754             return;
755         }
756         //console.log('render tree');
757         this.tree.render();
758     });
759     // this should not be needed.. - it's actually the 'el' that resizes?
760     // actuall it breaks the containerScroll - dragging nodes auto scroll at top
761     
762     //this.on('resize',  function (cp, w, h) {
763     //        this.tree.innerCt.setWidth(w);
764     //        this.tree.innerCt.setHeight(h);
765     //        //this.tree.innerCt.setStyle('overflow-y', 'auto');
766     //});
767
768         
769     
770 };
771
772 Roo.extend(Roo.TreePanel, Roo.ContentPanel, {   
773     fitToFrame : true,
774     autoScroll : true,
775     /*
776      * @cfg {Roo.tree.TreePanel} tree The tree TreePanel, with config etc.
777      */
778     tree : false
779
780 });
781
782
783
784
785
786
787
788
789
790
791