ext中tree以及viewport的使用方法

Ext.onReady(function(){
   var btn=new Ext.Button({text:"按钮"});
   var tree=new Ext.tree.TreePanel({
    	     title:"tree test",
    	     width:300,
    	     height:300,
    	     root:new Ext.tree.AsyncTreeNode({
    	     text:"root node",
    	     children:[{text:"children1",children:[{text:"children12",leaf:true}]},
    	    	 {text:"children21",leaf:true}]
    	     })
    	});
	var vp=new Ext.Viewport({
		layout:"border",
		items:[{region:"north",height:100,title:"顶部"},{region:"west",width:120,title:"目录",items:[btn,tree]},{region:"center",title:"内容部分"}]
	});
});

你可能感兴趣的:(ext)