<script type="text/javascript">
Ext.onReady(function(){
//定义树的跟节点
var rootNode = {
text : 'Root Node',
expanded : true,
children : [
{
text : 'Child 1',
leaf : true
},
{
text : 'Child 2',
leaf : true
},
{
text : 'Child 3',
children : [
{
text : 'Grand Child 1',
children : [
{
text : 'Grand... you get the point',
leaf : true
}
]
}
]
}
]
}
var tree = {
xtype : 'treepanel',
id : 'treepanel',
autoScroll : true,
root : rootNode
}
new Ext.Window({
height : 200,
width : 200,
layout : 'fit',
border : false,
title : 'Our first tree',
items : tree
}).show();
});
</script>
Ext.onReady(function(){
//定义树的跟节点
var rootNode = {
text : 'Root Node',
expanded : true,
children : [
{
text : 'Child 1',
leaf : true
},
{
text : 'Child 2',
leaf : true
},
{
text : 'Child 3',
children : [
{
text : 'Grand Child 1',
children : [
{
text : 'Grand... you get the point',
leaf : true
}
]
}
]
}
]
}
var tree = {
xtype : 'treepanel',
id : 'treepanel',
autoScroll : true,
root : rootNode
}
new Ext.Window({
height : 200,
width : 200,
layout : 'fit',
border : false,
title : 'Our first tree',
items : tree
}).show();
});
</script>