트리와 accordion

2981 단어 htmlext
layout:'accordion',  
                 layoutConfig:{  
                     animate:true,
                     hideCollapseTool:true
                 },  
                 items: [{  
                     title:' ',  
                     autoScroll:true,  
                     border:false,  
                     iconCls:'nav',  
                     html:'<div id="nav-tree" style="overflow:auto;height:400px;border:0px solid c3daf9;"></div>'
                    }  
                 ,{  
                     title:' ',  
                     html: '<div id="set-tree" style="overflow:auto;height:400px;border:0px solid c3daf9;"></div>',  
                     border:false,  
                     autoScroll:true,  
                     iconCls:'settings'  
                 }]  、


// ~~~
var navtree;
		var settree;
		var sroot;
		var root;
		if(!navtree){  
	        navtree = buildTree('nav-tree');
	        root = new Ext.tree.AsyncTreeNode({  
		         text: ' ',  
		         draggable:false,  
		         id:'nroot'  
		     });  
		    navtree.setRootNode(root);
	        root.appendChild(new Ext.tree.TreeNode({text:" "}));
	        navtree.render();  
     		root.expand(); 
        };
        
 if(!settree){
        	settree = new Ext.tree.TreePanel({  
		         autoShow:true,
		         autoScroll:true,		           
		         animate:true,  
		         border:false,  
		         enableDD:true,  
		         containerScroll: true,
		         lines:false, 
		         autoShow:true,
		         rootVisible:false})     	
        };
        sroot = new Ext.tree.AsyncTreeNode({  
		         text: ' ',  
		         draggable:false,  
		         id:'sroot'  
		});
        settree.setRootNode(sroot);
	    sroot.appendChild(new Ext.tree.TreeNode({text:" "}));
	    settree.render(Ext.get('set-tree'));
	    settree.expandAll(); 

       function buildTree(divid){
       		 var tree = new Ext.tree.TreePanel({  
		         el:divid, 
		         //applyTo:divid, 
		         autoScroll:true,		           
		         animate:true,  
		         border:false,  
		         enableDD:true,  
		         containerScroll: true,
		         lines:false, 
		         autoShow:true,
		         rootVisible:false});
		     return tree;
       };

 :http://www.iteye.com/topic/163280

좋은 웹페이지 즐겨찾기