我想自动填充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:'ShowPanel',<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 :"系统资源设定",<br>
layout :'accordion',// 下拉功能属性<br>
layoutConfig : {<br>
titleCollapse :false,<br>
animate :true,<br>
activeOnTop :true<br>
},<br>
items : [{<br>
title :'我的系统',<br>
html :'<div id="Mysystems" style="overflow:auto;width:100%;height:100%;border:0px solid #c3daf9"></div>'<br>
},{<br>
title :'系统设置',<br>
html :'<div id="tree-setting" style="overflow:auto;width:100%;height:100%"></div>'<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 :'我的系统目录',<br>
draggable :false,<br>
expanded :true,<br>
id :'root',<br>
href :'#'<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 :'Mysystems',<br>
//width :250,<br>
frame :true,<br>
layout:'fit',<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("OnClick");// 添加事件<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:'ShowPanel',<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 :"系统资源设定",<br> layout :'accordion',// 下拉功能属性<br> layoutConfig : {<br> titleCollapse :false,<br> animate :true,<br> activeOnTop :true<br> },<br> items : [{<br> title :'我的系统',<br> html :'<div id="Mysystems" style="overflow:auto;width:100%;height:100%;border:0px solid #c3daf9"></div>'<br> },{<br> title :'系统设置',<br> html :'<div id="tree-setting" style="overflow:auto;width:100%;height:100%"></div>'<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 :'我的系统目录',<br> draggable :false,<br> expanded :true,<br> id :'root',<br> href :'#'<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 :'Mysystems',<br><br> frame :true, </p> <pre><code> animate :true, useArrows :true, autoHeight :true, autoScroll :true, border :false }); this.addEvents("OnClick");// 添加事件 </code></pre> <p>}<br> }); <br>
<br> Ext.onReady( function() {<br> new Setting_Panel();<br> new Seeting_Treepanel(new Seeting_TreeRoot());</p> <pre><code> }); </script> </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>