java学习

java学习

 

extTree

function tree3(){
    var root=new Ext.tree.TreeNode({
      id:"root",
      href:"http://www.easyjf.com",
       hrefTarget:"_blank",
      text:"树的根"});
    var c1=new Ext.tree.TreeNode({
      id:"c1",
      href:"http://www.easyjf.com",
       hrefTarget:"_blank",
      text:"一级子节点1"
      });
    var c2=new Ext.tree.TreeNode({
      id:"c2",
      href:"http://www.easyjf.com",
       hrefTarget:"_blank",
      text:"一级子节点2"
      });
    var c3=new Ext.tree.TreeNode({
      id:"c3",
      href:"http://www.easyjf.com",
       hrefTarget:"_blank",
      text:"二级子节点1"
      });
    var c4=new Ext.tree.TreeNode({
      id:"c4",
      href:"http://www.easyjf.com",
       hrefTarget:"_blank",
      text:"二级子节点2"
      });
    root.appendChild(c1);
    root.appendChild(c2);
    c1.appendChild(c3);
    c2.appendChild(c4);
    var tree=new Ext.tree.TreePanel({
      renderTo:"hello",
      root:root,
      width:200
      });
    root.on("click",function(node,event){
      alert("您点击了"+node.text);
              }
          );
    c1.on("click",function(node,event){
      alert("您点击了"+node.text);
            }
     );
    c2.on("click",function(node,event){
      alert("您点击了"+node.text);
            }
     );
    c3.on("click",function(node,event){
      alert("您点击了"+node.text);
            }
     );
    c4.on("click",function(node,event){
      alert("您点击了"+node.text);
            }
     );    
   }

posted on 2012-10-23 15:30 杨军威 阅读(512) 评论(0)  编辑  收藏


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


网站导航:
 

导航

统计

常用链接

留言簿

随笔档案

搜索

最新评论

阅读排行榜

评论排行榜