Ext.onReady(function() {
var nodeData = [{text:'node',leaf:false,children:[{text:'childNode',leaf:false,children:[{text:'hello',leaf:true}]}]}]
var panel = new Ext.Panel({
title:'点击下面的链接',
region:'center',
html:'折叠'
})
var treePanel = new Ext.tree.TreePanel({
region:'west',
title:'treePanel',
split:true,
id:'treePanel',
collapseMode:'mini',
splite:true,
widht:500,
useArrows:true,
lines:false,
root:new Ext.tree.TreeNode({
text:'Root'
})
});
treePanel.getRootNode().appendChild(nodeData);
var view = new Ext.Viewport({
layout:'border',
items:[
treePanel,panel
]
});
})
给你写了一个例子 运行一下 是你要的效果 测试过的