日期:2014-05-16 浏览次数:20441 次
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="left.aspx.cs" Inherits="teachingAndStudy.Html.left" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" > <head runat="server"> <title>无标题页</title> <script src="../js/jq1.6.2.min.js" type="text/javascript"></script> <script src="../js/jquery.ztree-2.6.min.js" type="text/javascript"></script> <script type="text/javascript"> var zTree; var setting = { async: true, // 需要异步加载zTree asyncUrl: "../Public/getSubTree.ashx?who=0", // 异步加载时访问的页面 asyncParam: ["id"], // 异步加载时要传递的参数 isSimpleData: true, // 简单数据模型,必须提供下面的两项 treeNodeKey: "id", // 节点的id treeNodeParentKey: "pId", // 父节点的id showIcon : false, showLine: false, // zTree显示连接线 expandSpeed: "", // 设置 zTree 节点展开、折叠时的动画速度,默认为"fast",""表示无动画 callback: { // 回调函数 click: zTreeOnClick, // 单击鼠标时 asyncSuccess:zTreeOnAsyncSuccess //beforeAsync: zTreeBeforeAsync //rightClick: zTreeOnRightClick, // 鼠标右击 zTree //beforeRemove: zTreeOnBeforeRemove //remove: zTreeOnRemove } }; $(document).ready(function(){ zTree = $("#tree").zTree(setting, null); }); function zTreeOnAsyncSuccess(event, treeId, treeNode, msg) { zTree.expandAll(true); } } function zTreeOnClick(event, treeId, treeNode) { } </script> </head> <body> <div> <ul id="tree" class="tree" style="width:500px; overflow:visible;"></ul> </div> </body> </html>