ext怎么在panel里面增加一棵树?Ext.onReady(function(){ new Ext.Panel({ renderTo:"hello",title:"",//面板头部header width:300,height:500,border:false,layout:"border",items:[ {region:"south",height:400,width:100,id:'panel_hello',title:"t1",b
来源:学生作业帮助网 编辑:作业帮 时间:2024/07/02 01:50:51
![ext怎么在panel里面增加一棵树?Ext.onReady(function(){ new Ext.Panel({ renderTo:](/uploads/image/z/3875266-10-6.jpg?t=ext%E6%80%8E%E4%B9%88%E5%9C%A8panel%E9%87%8C%E9%9D%A2%E5%A2%9E%E5%8A%A0%E4%B8%80%E6%A3%B5%E6%A0%91%3FExt.onReady%28function%28%29%7B+new+Ext.Panel%28%7B+renderTo%3A%22hello%22%2Ctitle%3A%22%22%2C%2F%2F%E9%9D%A2%E6%9D%BF%E5%A4%B4%E9%83%A8header+width%3A300%2Cheight%3A500%2Cborder%3Afalse%2Clayout%3A%22border%22%2Citems%3A%5B+%7Bregion%3A%22south%22%2Cheight%3A400%2Cwidth%3A100%2Cid%3A%27panel_hello%27%2Ctitle%3A%22t1%22%2Cb)
ext怎么在panel里面增加一棵树?Ext.onReady(function(){ new Ext.Panel({ renderTo:"hello",title:"",//面板头部header width:300,height:500,border:false,layout:"border",items:[ {region:"south",height:400,width:100,id:'panel_hello',title:"t1",b
ext怎么在panel里面增加一棵树?
Ext.onReady(function(){
new Ext.Panel({
renderTo:"hello",
title:"",//面板头部header
width:300,
height:500,
border:false,
layout:"border",
items:[
{region:"south",
height:400,
width:100,
id:'panel_hello',
title:"t1",
border:false,
titleCollapse:false,//标题栏任何地方可点击
hideCollapseTool:false,//不显示右上角上的收缩按钮
collapsible:false,//右上角上的那个收缩按钮,设为false则不显示
frame:false,
collapsed:true,//如果为true,将panel渲染成收缩的,否则渲染成展开的(默认值为 false).
bodyStyle:"background-color:#313538;padding:10 0 10 0",//改变panel的底色
html:'111'},
{region:"center",
title:"t2",
border:false}
]
});
});
ext怎么在panel里面增加一棵树?Ext.onReady(function(){ new Ext.Panel({ renderTo:"hello",title:"",//面板头部header width:300,height:500,border:false,layout:"border",items:[ {region:"south",height:400,width:100,id:'panel_hello',title:"t1",b
Ext.onReady(function() {
var tree = new Ext.tree.TreePanel({
title :"test",
width :300,
height :450,
useArrows :true,// 是否使用箭头样式
autoScroll :true,// 滚动条
animate :true,// 展开,收缩动画
rootVisible :false,// 根节点是否可见
lines :false,// 禁止显示树的虚线
root :new Ext.tree.AsyncTreeNode({
text :"all",
children :[{
text :"aaa",
checked :false,
children :[{
text :"bbb",
checked :false,
children :[{
text :"新增",
id :"aaa",
checked :false,
leaf :true
},{
text :"修改",
checked :false,
leaf :true
},{
text :"删除",
checked :false,
leaf :true
},{
text :"刷新",
checked :false,
leaf :true
}]
},{
text :"ddd",
checked :false,
children :[{
text :"新增",
checked :false,
leaf :true
},{
text :"修改",
checked :false,
leaf :true
},{
text :"删除",
checked :false,
leaf :true
},{
text :"刷新",
checked :false,
leaf :true
}]
}]
},{
text :"ccc",
checked :false,
children :[{
text :"eee",
checked :false,
children :[{
text :"新增",
checked :false,
leaf :true
},{
text :"修改",
checked :false,
leaf :true
},{
text :"删除",
checked :false,
leaf :true
},{
text :"刷新",
checked :false,
leaf :true
}]
}]
}]
})
})
var views = new Ext.Panel({
width :300,
height :450,
border :true,
renderTo :Ext.getBody(),
items :[tree],
tbar :[{
text :"保存",
icon :"/hims/resources/images/icons/save.gif",
cls :"x-btn-text-icon",
handler :function() {
}
},"-",{
text :"刷新",
icon :"/hims/resources/images/icons/reload-green.png",
cls :"x-btn-text-icon",
handler :function() {
}
}]
});
})
extjs里面的组件是可以嵌套添加的
1.静态的: 直接放到items:[] 下就可以
2.动态的: 可以调用add()方法添加, 添加完成后,重新布局。