3.jsp
上传用户:zaktkj
上传日期:2022-08-08
资源大小:5770k
文件大小:2k
源码类别:

JavaScript

开发平台:

JavaScript

  1. <%@ page contentType="text/html;charset=utf-8"%>
  2. <%
  3.     String ctx = request.getContextPath();
  4.     String ext = ctx + "/../ext-2.0";
  5.     pageContext.setAttribute("ctx", ctx);
  6.     pageContext.setAttribute("ext", ext);
  7. %>
  8. <html>
  9.     <head>
  10.         <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  11.         <title>DWRTreeLoader</title>
  12.         <link rel="stylesheet" type="text/css" href="${ext}/resources/css/ext-all.css" />
  13.         <script type="text/javascript" src="${ext}/adapter/ext/ext-base.js"></script>
  14.         <script type="text/javascript" src="${ext}/ext-all.js"></script>
  15.         <script type="text/javascript" src="${ctx}/dwr/interface/treeNodeManager.js"></script>
  16.         <script type="text/javascript" src="${ctx}/dwr/engine.js"></script>
  17.         <script type="text/javascript" src="${ctx}/dwr/util.js"></script>
  18.         <script type="text/javascript" src="DWRTreeLoader.js"></script>
  19.         <script type="text/javascript">
  20. Ext.BLANK_IMAGE_URL = '${ext}/resources/images/default/s.gif';
  21. Ext.onReady(function(){
  22.     var tree = new Ext.tree.TreePanel({
  23.         el: 'tree',
  24.         loader: new Ext.tree.DWRTreeLoader({dataUrl: treeNodeManager.getTree})
  25.     });
  26.     var root = new Ext.tree.AsyncTreeNode({
  27.         id: '0',
  28.         text:'偶是根'
  29.     });
  30.     tree.setRootNode(root);
  31.     tree.render();
  32.     root.expand();
  33. });
  34.         </script>
  35.     </head>
  36.     <body>
  37.         <h1>DWRTreeLoader</h1>
  38.         <a href="index.jsp">返回</a>
  39.         <hr>
  40.         <div id="tree" style="height:300px;"></div>
  41.     </body>
  42. </html>