Examination_system/Examination_system-1/.svn/pristine/4e/4e94a57929017a441422143f0b1...

70 lines
2.5 KiB
Plaintext
Raw Normal View History

2023-10-30 13:10:40 +08:00
<!DOCTYPE html>
<HTML>
<HEAD>
<TITLE> ZTREE DEMO - Async</TITLE>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="../../../css/demo.css" type="text/css">
<link rel="stylesheet" href="../../../css/zTreeStyle/zTreeStyle.css" type="text/css">
<script type="text/javascript" src="../../../js/jquery-1.4.4.min.js"></script>
<script type="text/javascript" src="../../../js/jquery.ztree.core.js"></script>
<!-- <script type="text/javascript" src="../../../js/jquery.ztree.excheck.js"></script>
<script type="text/javascript" src="../../../js/jquery.ztree.exedit.js"></script>-->
<SCRIPT type="text/javascript">
<!--
var setting = {
async: {
enable: true,
url:"../asyncData/getNodes.php",
autoParam:["id", "name=n", "level=lv"],
otherParam:{"otherParam":"zTreeAsyncTest"},
dataFilter: filter
}
};
function filter(treeId, parentNode, childNodes) {
if (!childNodes) return null;
for (var i=0, l=childNodes.length; i<l; i++) {
childNodes[i].name = childNodes[i].name.replace(/\.n/g, '.');
}
return childNodes;
}
$(document).ready(function(){
$.fn.zTree.init($("#treeDemo"), setting);
});
//-->
</SCRIPT>
</HEAD>
<BODY>
<h1>Dynamic Tree with Ajax</h1>
<h6>[ File Path: core/async.html ]</h6>
<div class="content_wrap">
<div class="zTreeDemoBackground left">
<ul id="treeDemo" class="ztree"></ul>
</div>
<div class="right">
<ul class="info">
<li class="title"><h2>1, Explanation of setting</h2>
<ul class="list">
<li class="highlight_red">For create dynamic tree with ajax, you need to set attributes in setting.async, see the API documentation for more related contents.</li>
</ul>
</li>
<li class="title"><h2>2, Explanation of treeNode</h2>
<ul class="list">
<li>Dynamic tree with ajax doesn't need to make special treeNode node data, if use simple JSON data model, please set the attributes in setting.data.simple.</li>
<li>If ajax only to return node data in single level, you don't need to use simple JSON data model.</li>
</ul>
</li>
<li class="title"><h2>3、Other explanation</h2>
<ul class="list">
<li class="highlight_red">Monitoring autoParam and otherParam use firebug or the developer tools in browser.</li>
<li class="highlight_red">This Demo only loading 4 level nodes (level = 3).</li>
<li class="highlight_red">This Demo use 'dataFilter' to modify the name of the node.</li>
</ul>
</li>
</ul>
</div>
</div>
</BODY>
</HTML>