沉睡森林@漂在北京

本处文章除注明“转载”外均为原创,转载请注明出处。

  BlogJava :: 首页 :: 新随笔 :: 联系 :: 聚合  :: 管理 ::
  152 随笔 :: 4 文章 :: 114 评论 :: 0 Trackbacks
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Drag and Drop between 2 TreePanels</title>
<link rel="stylesheet" type="text/css" href="../../resources/css/ext-all.css" />
     <script type="text/javascript" src="../../adapter/ext/ext-base.js"></script>
     <script type="text/javascript" src="../../ext-all.js"></script>
 
</head>
<body>
 
<div  id="tree-div"></div>

<script>
      Ext.onReady(function(){
           var json =[{'text':'A','id':'a','leaf':false,'children':[{'text':'A1','id':'a1','leaf':false,'children':[{'text':'A11','id':'a11','leaf':true},{'text':'A12','id':'a12','leaf':true},{'text':'A13','id':'a13','leaf':true},{'text':'A14','id':'a14','leaf':true}]},{'text':'A2','id':'a2','leaf':true}]},{'text':'B1','id':'b1','leaf':false,'children':[{'text':'B11','id':'b11','leaf':true},{'text':'B11','id':'b12','leaf':false,'children':[{'text':'B121','id':'b121','leaf':true}]}]}];
                var tree = new Ext.tree.TreePanel({
                    animate: true,
                    enableDD: false,
                    loader: new Ext.tree.TreeLoader(),
                    lines: true,
                    selModel: new Ext.tree.MultiSelectionModel(),
                    containerScroll: false
                });

                var root = new Ext.tree.AsyncTreeNode({
                    text: 'Autos',
                    draggable: false,
                    id: 'source',
                    children: json
                });
              
                tree.setRootNode(root);
                tree.render(document.body);
                root.expand();
            });
</script>
<div id="tree"></div>

</body>
</html>


posted on 2008-10-30 21:04 王总兵 阅读(640) 评论(2)  编辑  收藏 所属分类: Ext

评论

# re: 贴一个EXT的Tree的例子[未登录] 2008-10-31 15:26 shadow
谢谢了  回复  更多评论
  

# re: 贴一个EXT的Tree的例子 2008-12-01 11:22 ys
照例谢谢啦~~~  回复  更多评论
  


只有注册用户登录后才能发表评论。


网站导航: