【ztree】ztree例子

<script language="javascript" type="text/javascript" src="js/jquery.js"></script>
<script language="javascript" type="text/javascript" src="js/jquery.ztree.core-3.0.js"></script>
<link type="text/css" rel="stylesheet" href="css/zTreeStyle/zTreeStyle.css" />

 

<ul id="tree" class="ztree"></ul>

 

$(document).ready(function(){
    var Index = {
        init:function(){
            var setting = {
                treeId:'tree'
            };
            var data = [
                {id:1, pId:0, name: "父节点1"},
                {id:11, pId:1, name: "子节点1"},
                {id:12, pId:1, name: "子节点2"}
            ];
            var zTree = $.fn.zTree.init($("#tree"), setting, data); }, 
  }
  $(Index.init);
});

 

posted @ 2014-11-09 16:37  空城夕  阅读(314)  评论(0编辑  收藏  举报