.net 下 ztree 不显示

dnf 发布于 2013/08/07 16:17
阅读 227
收藏 0

@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}];

加载中
0
zTree
zTree

请 检查代码执行后是否有报错? 文件加载是否都正常?


返回顶部
顶部