extjs 动态树

extjs 动态树。
写完接近崩溃边缘... 不废话直接贴代码
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<link rel="stylesheet" type="text/css" href="pagesExt/extjs2.0/resources/css/ext-all.css" />
<link rel="stylesheet" type="text/css" href="pagesExt/css/style.css" />
<script type="text/javascript" src="pagesExt/extjs2.0/adapter/ext/ext-base.js"></script>
<script type="text/javascript" src="pagesExt/extjs2.0/ext-all.js"></script>
<script type="text/javascript" src="pagesExt/extjs2.0/source/locale/ext-lang-zh_CN.js"></script>
<script type="text/javascript" src="pagesExt/extjs2.0/ext/themeChange.js"></script>
<link rel="stylesheet" href="Contents/Style.css" type="text/css" />
<script language="JavaScript" src="JSClass/FusionCharts.js"></script>



<script type="text/javascript">
<!--



Ext.BLANK_IMAGE_URL = 'pagesExt/extjs2.0/resources/images/default/s.gif';
var root=new Ext.tree.AsyncTreeNode({
            id:"-100",//根节点id
            expanded :true,
            text:"后台管理"
      });  


var treeLoa = new Ext.tree.TreeLoader({
dataUrl:'sys/sd?hellow=',
});


Ext.onReady(function() {

new Ext.Viewport( {
enableTabScroll : true,
layout : "border",
items : [ {
title : "面板",
region : "north",
height : 100,
html : "<center><h1>网站后台管理系统!</h1></center>",
collapsible:true,
bbar :[
{
id:'BA',text:"注册",iconCls:'addup',
                handler:   function(){ 
                 window.location.href="pagesExt/Adduser.jsp";
                 } 
},
'->',

id:'CB',text:"登录",iconCls:'login',
                 handler: function(){ 
                 window.location.href="pagesExt/Login.jsp";
                 }
}
]

}, {
        region: 'west',
        collapsible: true,
        title: 'Navigation',
        xtype: 'treepanel',
        width: 200,
        loader : treeLoa,
        autoScroll: true,
        root:root,
        split: true,
        rootVisible: false,
        tbar : [
'皮肤选择:',
{
xtype : 'themeChange',
width : 80,
listWidth : 80
},
'->'
],
bbar : [
{
width : 80,
listWidth : 80
}
],
        listeners : {
click : function(node,e){
mainPanel.load({ 
url:node.attributes.url,
callback : function(){
mainPanel.setTitle(node.text);
},
scripts: true
});
}
}
    }, {
xtype : "tabpanel",
region : "center",
id : 'mainContent'

} ]
});
var mainPanel = Ext.getCmp('mainContent');
})
//-->
</script>
<html>
  <head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <base href="<%=basePath%>">
   
    <title>My JSP 'MyIndex.jsp' starting page</title>
  </head>
 
  <body>
  </body>
</html>

你可能感兴趣的:(html,jsp,ext)