.net 下 ztree 不显示
@zTree 你好,想跟你请教个问题:
我在.net中应用了ztree3.2,为什么树不显示呢,我曾尝试修改代码,正常使用过一阵子又不行了,很奇怪,求正解.
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="left.aspx.cs" Inherits="KLYHJXKH.Views.xtgl.dwgl.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 id="Head1" runat="server">
<title></title>
<script type="text/javascript" src="/Scripts/jquery/jquery-1.7.2.js"></script>
<link rel="stylesheet" href="/Scripts/jquery/ztree/css/zTreeStyle/zTreeStyle.css" type="text/css"/>
<script type="text/javascript" src="/Scripts/jquery/ztree/js/jquery.ztree.core-3.2.js"></script>
<!--
<link rel="Stylesheet" href="../../../Content/default.css" />
<script type="text/javascript" src="../../../Scripts/jquery/jquery-1.7.2.js"></script>
<link rel="stylesheet" href="../../../Scripts/jquery/ztree/css/zTreeStyle/zTreeStyle.css" type="text/css" />
<script type="text/javascript" src="../../../Scripts/jquery/ztree/js/jquery.ztree.core-3.2.js"></script>
-->
<script type="text/javascript">
var setting = {
async:{
enable :true,
url: "../common/asynctreenode.aspx",
autoParam: ["id","name"]
},
view: {
dblClickExpand: false,
showLine: true,
selectedMulti: false,
expandSpeed: ($.browser.msie && parseInt($.browser.version)<=6)?"":"fast"
},
callback: {
beforeClick: function(treeId, treeNode){
window.parent.maincontent.location.replace('maincontent.aspx?sjdwbm='+treeNode.id+"&sjdwmc="+treeNode.name);
}
}
};
var zrootNodes = <% =NodesData %>;
$(document).ready(function () {
//以下为第一次要加载的一级节点
$.fn.zTree.init($("#treeDemo"), setting, zrootNodes);
});
</script>
</head>
<body>
<div class="zTreeDemoBackground left">
<ul id="treeDemo" class="ztree"></ul>
</div>
</body>
</html>
补充:
var zrootNodes = [{'id':'krl','name':'krl',isParent:true}];
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
请 检查代码执行后是否有报错? 文件加载是否都正常?