如何设置treepanel的高度让其自动填充到这个的panel里,见图。

我想自动填充treepanel到整个panel里,还有让其填充整个tabpanel?请问如何设置属性。见附件图。
[b]问题补充:[/b]
layout:'fit'
这个不对,反正我这里没有效果。
[b]问题补充:[/b]
还是不行,给你代码,帮我测试一下啊,谢谢。[code="java"]<br><br> Setting_Panel=Ext.extend(Ext.form.FormPanel,{<br> constructor:function(){<br> Setting_Panel.superclass.constructor.call(this,{<br><br> renderTo:&#39;ShowPanel&#39;,<br><br> split :true,<br> width:500,<br> draggable :true,<br> height:600,<br> collapsible :true,<br> fitToFrame :true,<br> closable :true,<br> frame:true,<br> title :&quot;系统资源设定&quot;,<br> layout :&#39;accordion&#39;,// 下拉功能属性<br> layoutConfig : {<br> titleCollapse :false,<br> animate :true,<br> activeOnTop :true<br> },<br> items : [{<br> title :&#39;我的系统&#39;,<br> html :&#39;<div id="Mysystems" style="overflow:auto;width:100%;height:100%;border:0px solid #c3daf9"></div>&#39;<br> },{<br> title :&#39;系统设置&#39;,<br> html :&#39;<div id="tree-setting" style="overflow:auto;width:100%;height:100%"></div>&#39;<br> }]<br> })<br> }<br> });</p> <p>Seeting_TreeRoot = Ext.extend(Ext.tree.AsyncTreeNode, {<br> constructor : function() {<br> Seeting_TreeRoot.superclass.constructor.call(this, {<br> text :&#39;我的系统目录&#39;,<br> draggable :false,<br> expanded :true,<br> id :&#39;root&#39;,<br> href :&#39;#&#39;<br> })<br> }<br> });<br> Seeting_Treepanel = Ext.extend(Ext.tree.TreePanel, {<br> Root :null,<br> constructor : function(Root) {<br> this.Root = Root;<br> Seeting_Treepanel.superclass.constructor.call(this, {<br> root :this.Root,<br> renderTo :&#39;Mysystems&#39;,<br> //width :250,<br> frame :true,<br> layout:&#39;fit&#39;,<br><br> autoWidth:true ,<br> autoHeigth:false,<br><br> // loader:treeLoader,<br> animate :true,<br> useArrows :true,<br> autoHeight :true,<br> autoScroll :true,<br> border :false<br> });<br> this.addEvents(&quot;OnClick&quot;);// 添加事件<br> }<br> }); <br> [/code]
[b]问题补充:[/b]
yourgame (架构师)
你猜的很对,但我这里再试一下,可能没理解你的意思。谢谢,在比赛结束之前我结贴。
[b]问题补充:[/b]
[code="java"]
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" isELIgnored="false"%>
<%@ taglib prefix="s" uri="/struts-tags"%>





<br><br> Setting_Panel=Ext.extend(Ext.form.FormPanel,{<br> constructor:function(){<br> Setting_Panel.superclass.constructor.call(this,{<br><br> renderTo:&#39;ShowPanel&#39;,<br><br> split :true,<br> width:500,<br> draggable :true,<br> height:600,<br> collapsible :true,<br> fitToFrame :true,<br> closable :true,<br> frame:true,<br> title :&quot;系统资源设定&quot;,<br> layout :&#39;accordion&#39;,// 下拉功能属性<br> layoutConfig : {<br> titleCollapse :false,<br> animate :true,<br> activeOnTop :true<br> },<br> items : [{<br> title :&#39;我的系统&#39;,<br> html :&#39;<div id="Mysystems" style="overflow:auto;width:100%;height:100%;border:0px solid #c3daf9"></div>&#39;<br> },{<br> title :&#39;系统设置&#39;,<br> html :&#39;<div id="tree-setting" style="overflow:auto;width:100%;height:100%"></div>&#39;<br> }]<br> })<br> }<br> });</p> <p>Seeting_TreeRoot = Ext.extend(Ext.tree.AsyncTreeNode, {<br> constructor : function() {<br> Seeting_TreeRoot.superclass.constructor.call(this, {<br> text :&#39;我的系统目录&#39;,<br> draggable :false,<br> expanded :true,<br> id :&#39;root&#39;,<br> href :&#39;#&#39;<br> })<br> }<br> });<br> Seeting_Treepanel = Ext.extend(Ext.tree.TreePanel, {<br> Root :null,<br> constructor : function(Root) {<br> this.Root = Root;<br> Seeting_Treepanel.superclass.constructor.call(this, {<br> root :this.Root,<br> renderTo :&#39;Mysystems&#39;,<br><br> frame :true, </p> <pre><code> animate :true, useArrows :true, autoHeight :true, autoScroll :true, border :false }); this.addEvents(&quot;OnClick&quot;);// 添加事件 </code></pre> <p>}<br> }); <br>
<br> Ext.onReady( function() {<br> new Setting_Panel();<br> new Seeting_Treepanel(new Seeting_TreeRoot());</p> <pre><code> }); &lt;/script&gt; </code></pre> <p><body><br><br> <div id="showPanel" ></div><br> </body><br> </html>[/code]<br> [b]问题补充:[/b]<br> 不过你要引入Extjs的包 2.2.1或者2.2都可以。<br> [b]问题补充:[/b]<br> ==,我等下贴上来,我要整理一下,半个小时候<br> [b]问题补充:[/b]<br> 代码已经放到[url]<a href="http://www.iteye.com/problems/18668%5B/url%5D%E9%87%8C%E4%BA%86%EF%BC%8C%E8%AF%B7%E6%9F%A5%E7%9C%8B%EF%BC%81">http://www.iteye.com/problems/18668[/url]里了,请查看!</a></p>

郁闷,你给我的代码和你的截图不相符呀?我只能看到一个左边的树,而且左边的树也没有什么问题,从你的代码来看,你写得很糟糕.

[code="js"]
items : [{
title : '我的系统',
html : '

'
}, {
title : '系统设置',
html : '
'
}]
[/code]

及不同意你这样写

能不能把你截图的代码贴出来

layout:'fit'

还要加上
autoWidth:true
autoHeigth:true

从你的图片来看你用了accodion布局.没有你的代码.也无法帮你修改.
我可以给你一些参考

"系统资源设定"的那个panel的上级是不是tab,如果是的话,这个panel设定为fit或者tab的layout:'border',然后"系统资源设定"这个panel设定region:'center'也可以实现填充满
从图片可以看出你"系统资源设定"的panel中可能是layout:'accodion' 那么你accodion里面的子对象,比如说treepanel就要fit或者同之前说的那种方式填充也可以

至于"左边面板" 同理

代码没有给全