<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); });
时间: 2024-10-11 13:48:55