提交 9916b22e 编写于 作者: Z ztree

完善 API 文档

上级 9116007d
......@@ -263,7 +263,8 @@ var apiContent = {
{id:432, pId:4, t:"hideNode", name:"hideNode (node)", iconSkin:"hide", showAPI:true},
{id:433, pId:4, t:"hideNodes", name:"hideNodes (nodes)", iconSkin:"hide", showAPI:true},
{id:420, pId:4, t:"moveNode", name:"moveNode (targetNode, node, moveType, isSilent)", iconSkin:"edit", showAPI:true},
{id:421, pId:4, t:"reAsyncChildNodes", name:"reAsyncChildNodes (parentNode, reloadType, isSilent)", iconSkin:"core", showAPI:true},
{id:421, pId:4, t:"reAsyncChildNodes", name:"reAsyncChildNodes (parentNode, reloadType, isSilent, callback)", iconSkin:"core", showAPI:true},
{id:437, pId:4, t:"reAsyncChildNodesPromise", name:"reAsyncChildNodesPromise(parentNode, reloadType, isSilent)", iconSkin:"core", showAPI:true},
{id:422, pId:4, t:"refresh", name:"refresh ()", iconSkin:"core", showAPI:true},
{id:423, pId:4, t:"removeChildNodes", name:"removeChildNodes (parentNode)", iconSkin:"core", showAPI:true},
{id:424, pId:4, t:"removeNode", name:"removeNode (node, callbackFlag)", iconSkin:"core", showAPI:true},
......
<div class="apiDetail">
<div>
<h2><span>Function(parentNode, reloadType, isSilent)</span><span class="path">zTreeObj.</span>reAsyncChildNodes</h2>
<h3>概述<span class="h3_info">[ 依赖 <span class="highlight_green">jquery.ztree.core</span> 核心 js ]</span></h3>
<div class="desc">
<p></p>
<div class="longdesc">
<p>强行异步加载父节点的子节点。<span class="highlight_red">[setting.async.enable = true 时有效]</span></p>
<p class="highlight_red">已经加载过的父节点可反复使用此方法重新加载。</p>
<p class="highlight_red">请通过 zTree 对象执行此方法。</p>
</div>
</div>
<h3>Function 参数说明</h3>
<div class="desc">
<h4><b>parentNode</b><span>JSON</span></h4>
<p>指定需要异步加载的父节点 JSON 数据</p>
<p class="highlight_red">1、parentNode = null 时,相当于从根节点 Root 进行异步加载</p>
<p class="highlight_red">2、parentNode.isParent = false 时,不进行异步加载</p>
<p class="highlight_red">3、请务必保证此节点数据对象 是 zTree 内部的数据对象</p>
<h4 class="topLine"><b>reloadType</b><span>String</span></h4>
<p>reloadType = "refresh" 表示清空后重新加载。</p>
<p>reloadType != "refresh" 时,表示追加子节点处理。</p>
<h4 class="topLine"><b>isSilent</b><span>Boolean</span></h4>
<p>设定异步加载后是否自动展开父节点。</p>
<p>isSilent = true 时,不展开父节点,其他值或缺省状态都自动展开。</p>
<h4 class="topLine"><b>返回值</b><span></span></h4>
<p>目前无任何返回值</p>
</div>
<h3>function 举例</h3>
<h4>1. 重新异步加载 zTree </h4>
<pre xmlns=""><code>var treeObj = $.fn.zTree.getZTreeObj("tree");
<div>
<h2><span>Function(parentNode, reloadType, isSilent, callback)</span><span class="path">zTreeObj.</span>reAsyncChildNodes
</h2>
<h3>概述<span class="h3_info">[ 依赖 <span class="highlight_green">jquery.ztree.core</span> 核心 js ]</span></h3>
<div class="desc">
<p></p>
<div class="longdesc">
<p>强行异步加载父节点的子节点。<span class="highlight_red">[setting.async.enable = true 时有效]</span></p>
<p class="highlight_red">已经加载过的父节点可反复使用此方法重新加载。</p>
<p class="highlight_red">请通过 zTree 对象执行此方法。</p>
</div>
</div>
<h3>Function 参数说明</h3>
<div class="desc">
<h4><b>parentNode</b><span>JSON</span></h4>
<p>指定需要异步加载的父节点 JSON 数据</p>
<p class="highlight_red">1、parentNode = null 时,相当于从根节点 Root 进行异步加载</p>
<p class="highlight_red">2、parentNode.isParent = false 时,不进行异步加载</p>
<p class="highlight_red">3、请务必保证此节点数据对象 是 zTree 内部的数据对象</p>
<h4 class="topLine"><b>reloadType</b><span>String</span></h4>
<p>reloadType = "refresh" 表示清空后重新加载。</p>
<p>reloadType != "refresh" 时,表示追加子节点处理。</p>
<h4 class="topLine"><b>isSilent</b><span>Boolean</span></h4>
<p>设定异步加载后是否自动展开父节点。</p>
<p>isSilent = true 时,不展开父节点,其他值或缺省状态都自动展开。</p>
<h4 class="topLine"><b>callback</b><span>function</span></h4>
<p>刷新完成后的回调函数。</p>
<h4 class="topLine"><b>返回值</b><span></span></h4>
<p>目前无任何返回值</p>
</div>
<h3>function 举例</h3>
<h4>1. 重新异步加载 zTree </h4>
<pre xmlns=""><code>var treeObj = $.fn.zTree.getZTreeObj("tree");
treeObj.reAsyncChildNodes(null, "refresh");
</code></pre>
<h4>2. 重新异步加载当前选中的第一个节点</h4>
<pre xmlns=""><code>var treeObj = $.fn.zTree.getZTreeObj("tree");
<h4>2. 重新异步加载当前选中的第一个节点</h4>
<pre xmlns=""><code>var treeObj = $.fn.zTree.getZTreeObj("tree");
var nodes = treeObj.getSelectedNodes();
if (nodes.length>0) {
treeObj.reAsyncChildNodes(nodes[0], "refresh");
}
</code></pre>
</div>
</div>
</div>
\ No newline at end of file
<div class="apiDetail">
<div>
<h2><span>Function(parentNode, reloadType, isSilent)</span><span class="path">zTreeObj.</span>reAsyncChildNodesPromise
</h2>
<h3>概述<span class="h3_info">[ 依赖 <span class="highlight_green">jquery.ztree.core</span> 核心 js ]</span></h3>
<div class="desc">
<p></p>
<div class="longdesc">
<p>强行异步加载父节点的子节点(ES6 Promise 版)。<span class="highlight_red">[setting.async.enable = true 时有效]</span></p>
<p class="highlight_red">已经加载过的父节点可反复使用此方法重新加载。</p>
<p class="highlight_red">请通过 zTree 对象执行此方法。</p>
<p class="highlight_red">v3.5.29+</p>
</div>
</div>
<h3>Function 参数说明</h3>
<div class="desc">
<h4><b>parentNode</b><span>JSON</span></h4>
<p>指定需要异步加载的父节点 JSON 数据</p>
<p class="highlight_red">1、parentNode = null 时,相当于从根节点 Root 进行异步加载</p>
<p class="highlight_red">2、parentNode.isParent = false 时,不进行异步加载</p>
<p class="highlight_red">3、请务必保证此节点数据对象 是 zTree 内部的数据对象</p>
<h4 class="topLine"><b>reloadType</b><span>String</span></h4>
<p>reloadType = "refresh" 表示清空后重新加载。</p>
<p>reloadType != "refresh" 时,表示追加子节点处理。</p>
<h4 class="topLine"><b>isSilent</b><span>Boolean</span></h4>
<p>设定异步加载后是否自动展开父节点。</p>
<p>isSilent = true 时,不展开父节点,其他值或缺省状态都自动展开。</p>
<h4 class="topLine"><b>返回值</b><span>ES6 Promise</span></h4>
<p>ES6 的 Promise 对象,便于异步控制,使用时请注意浏览器兼容问题</p>
</div>
<h3>function 举例</h3>
<h4>1. 重新异步加载 zTree </h4>
<pre xmlns=""><code>var treeObj = $.fn.zTree.getZTreeObj("tree");
treeObj.reAsyncChildNodes(null, "refresh");
</code></pre>
<h4>2. 重新异步加载当前选中的第一个节点</h4>
<pre xmlns=""><code>var treeObj = $.fn.zTree.getZTreeObj("tree");
var nodes = treeObj.getSelectedNodes();
if (nodes.length>0) {
treeObj.reAsyncChildNodes(nodes[0], "refresh");
}
</code></pre>
</div>
</div>
\ No newline at end of file
<div class="apiDetail">
<div>
<h2><span>Function(parentNode, reloadType, isSilent)</span><span class="path">zTreeObj.</span>reAsyncChildNodes</h2>
<h3>Overview<span class="h3_info">[ depends on <span class="highlight_green">jquery.ztree.core</span> js ]</span></h3>
<div class="desc">
<p></p>
<div class="longdesc">
<p>Forced asynchronous loading child nodes of parent node. It is valid when <span class="highlight_red">[setting.async.enable = true]</span></p>
<p class="highlight_red">You can use this method to reload child nodes.</p>
<p class="highlight_red">Please use zTree object to executing the method.</p>
</div>
</div>
<h3>Function Parameter Descriptions</h3>
<div class="desc">
<h4><b>parentNode</b><span>JSON</span></h4>
<p>The parent node which will asynchronous loading child nodes.</p>
<p class="highlight_red">1. If parentNode = null, it is same as reload root nodes.</p>
<p class="highlight_red">2. If parentNode.isParent = false, don't load nodes.</p>
<p class="highlight_red">3. Please ensure that this data object is an internal node data object in zTree.</p>
<h4 class="topLine"><b>reloadType</b><span>String</span></h4>
<p>reloadType = "refresh" means: reload child nodes.</p>
<p>reloadType != "refresh" means: append to load child nodes.</p>
<h4 class="topLine"><b>isSilent</b><span>Boolean</span></h4>
<p>Set whether to automatically expand the parent node, after load nodes.</p>
<p>isSilent = true means: don't auto expand the parent node. Otherwise auto expand.</p>
<h4 class="topLine"><b>Return </b><span>none</span></h4>
<p>no return value</p>
</div>
<h3>Examples of function</h3>
<h4>1. reload root nodes</h4>
<pre xmlns=""><code>var treeObj = $.fn.zTree.getZTreeObj("tree");
<div>
<h2><span>Function(parentNode, reloadType, isSilent, callback)</span><span class="path">zTreeObj.</span>reAsyncChildNodes
</h2>
<h3>Overview<span class="h3_info">[ depends on <span
class="highlight_green">jquery.ztree.core</span> js ]</span></h3>
<div class="desc">
<p></p>
<div class="longdesc">
<p>Forced asynchronous loading child nodes of parent node. It is valid when <span class="highlight_red">[setting.async.enable = true]</span>
</p>
<p class="highlight_red">You can use this method to reload child nodes.</p>
<p class="highlight_red">Please use zTree object to executing the method.</p>
</div>
</div>
<h3>Function Parameter Descriptions</h3>
<div class="desc">
<h4><b>parentNode</b><span>JSON</span></h4>
<p>The parent node which will asynchronous loading child nodes.</p>
<p class="highlight_red">1. If parentNode = null, it is same as reload root nodes.</p>
<p class="highlight_red">2. If parentNode.isParent = false, don't load nodes.</p>
<p class="highlight_red">3. Please ensure that this data object is an internal node data object in
zTree.</p>
<h4 class="topLine"><b>reloadType</b><span>String</span></h4>
<p>reloadType = "refresh" means: reload child nodes.</p>
<p>reloadType != "refresh" means: append to load child nodes.</p>
<h4 class="topLine"><b>isSilent</b><span>Boolean</span></h4>
<p>Set whether to automatically expand the parent node, after load nodes.</p>
<p>isSilent = true means: don't auto expand the parent node. Otherwise auto expand.</p>
<h4 class="topLine"><b>callback</b><span>function</span></h4>
<p>zTree will trigger this callback() function after reAsyncChildNodes()</p>
<h4 class="topLine"><b>Return </b><span>none</span></h4>
<p>no return value</p>
</div>
<h3>Examples of function</h3>
<h4>1. reload root nodes</h4>
<pre xmlns=""><code>var treeObj = $.fn.zTree.getZTreeObj("tree");
treeObj.reAsyncChildNodes(null, "refresh");
</code></pre>
<h4>2. reload the first selected node's child nodes.</h4>
<pre xmlns=""><code>var treeObj = $.fn.zTree.getZTreeObj("tree");
<h4>2. reload the first selected node's child nodes.</h4>
<pre xmlns=""><code>var treeObj = $.fn.zTree.getZTreeObj("tree");
var nodes = treeObj.getSelectedNodes();
if (nodes.length>0) {
treeObj.reAsyncChildNodes(nodes[0], "refresh");
}
</code></pre>
</div>
</div>
</div>
\ No newline at end of file
<div class="apiDetail">
<div>
<h2><span>Function(parentNode, reloadType, isSilent)</span><span class="path">zTreeObj.</span>reAsyncChildNodesPromise
</h2>
<h3>Overview<span class="h3_info">[ depends on <span
class="highlight_green">jquery.ztree.core</span> js ]</span></h3>
<div class="desc">
<p></p>
<div class="longdesc">
<p>Forced asynchronous loading child nodes of parent node ( for ES6 Promise ). It is valid when <span class="highlight_red">[setting.async.enable = true]</span>
</p>
<p class="highlight_red">You can use this method to reload child nodes.</p>
<p class="highlight_red">Please use zTree object to executing the method.</p>
<p class="highlight_red">v3.5.29+</p>
</div>
</div>
<h3>Function Parameter Descriptions</h3>
<div class="desc">
<h4><b>parentNode</b><span>JSON</span></h4>
<p>The parent node which will asynchronous loading child nodes.</p>
<p class="highlight_red">1. If parentNode = null, it is same as reload root nodes.</p>
<p class="highlight_red">2. If parentNode.isParent = false, don't load nodes.</p>
<p class="highlight_red">3. Please ensure that this data object is an internal node data object in
zTree.</p>
<h4 class="topLine"><b>reloadType</b><span>String</span></h4>
<p>reloadType = "refresh" means: reload child nodes.</p>
<p>reloadType != "refresh" means: append to load child nodes.</p>
<h4 class="topLine"><b>isSilent</b><span>Boolean</span></h4>
<p>Set whether to automatically expand the parent node, after load nodes.</p>
<p>isSilent = true means: don't auto expand the parent node. Otherwise auto expand.</p>
<h4 class="topLine"><b>Return </b><span>ES6 Promise</span></h4>
<p>Promise Object of ES6</p>
</div>
<h3>Examples of function</h3>
<h4>1. reload root nodes</h4>
<pre xmlns=""><code>var treeObj = $.fn.zTree.getZTreeObj("tree");
treeObj.reAsyncChildNodes(null, "refresh");
</code></pre>
<h4>2. reload the first selected node's child nodes.</h4>
<pre xmlns=""><code>var treeObj = $.fn.zTree.getZTreeObj("tree");
var nodes = treeObj.getSelectedNodes();
if (nodes.length>0) {
treeObj.reAsyncChildNodes(nodes[0], "refresh");
}
</code></pre>
</div>
</div>
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册