提交 802e6961 编写于 作者: Z ztree

fixed text error

上级 b71c04d0
......@@ -5,7 +5,7 @@
<div class="desc">
<p></p>
<div class="longdesc">
<p>The data type of Ajax. It is valid when <span class="highlight_red">[setting.async.enable = true]</span></p>
<p>The data type of Ajax requests. It is valid when <span class="highlight_red">[setting.async.enable = true]</span></p>
<p>Default:"text"</p>
</div>
</div>
......
......@@ -5,36 +5,36 @@
<div class="desc">
<p></p>
<div class="longdesc">
<p>The static parameters of the Ajax request. (key - value) It is valid when <span class="highlight_red">[setting.async.enable = true]</span></p>
<p>The query parameters of the Ajax request. (key - value) It is valid when <span class="highlight_red">[setting.async.enable = true]</span></p>
<p>Default: [ ]</p>
</div>
</div>
<h3>Array(String) Format</h3>
<div class="desc">
<p>Can be empty array. e.g. [ ]. If set key, you must set value, e.g. [key, value]. ([key] or [key, value, key] is wrong!!)</p>
<p>Can be an empty array. e.g. [ ]. The array should contain key value pairs, e.g. [key, value]. (Either or [key] or [key, value, key] is wrong!!)</p>
</div>
<h3>JSON Format</h3>
<div class="desc">
<p>Use JSON data format set the key-value. e.g. { key1:value1, key2:value2 }</p>
<p>Use JSON hash data to set the key-value pairs. e.g. { key1:value1, key2:value2 }</p>
</div>
<h3>Examples of setting</h3>
<h4>1. Use Array(String) Format</h4>
<h4>1. Using Array(String) Format</h4>
<pre xmlns=""><code>var setting = {
async: {
enable: true,
url: "http://host/getNode.php",
otherParam: ["id", "1", "name", "test"]
<span style="color:red">otherParam: ["id", "1", "name", "test"]</span>
}
};
when zTree send ajax, the parameters will has: id=1&name=test</code></pre>
<h4>2. Use JSON data Format</h4>
when zTree sends the ajax request, the query string will be like this: id=1&name=test</code></pre>
<h4>2. Using JSON data Format</h4>
<pre xmlns=""><code>var setting = {
async: {
enable: true,
url: "http://host/getNode.php",
otherParam: { "id":"1", "name":"test"}
<span style="color:red">otherParam: { "id":"1", "name":"test"}</span>
}
};
when zTree send ajax, the parameters will has: id=1&name=test</code></pre>
when zTree sends the ajax request, the query string will be like this: id=1&name=test</code></pre>
</div>
</div>
\ No newline at end of file
......@@ -5,15 +5,15 @@
<div class="desc">
<p></p>
<div class="longdesc">
<p>Http request mode in ajax. It is valid when <span class="highlight_red">[setting.async.enable = true]</span></p>
<p>Defalut: "post"</p>
<p>Http request tyoe in ajax. It is valid when <span class="highlight_red">[setting.async.enable = true]</span></p>
<p>Default: "post"</p>
</div>
</div>
<h3>String Format</h3>
<div class="desc">
<p> "post" - http request mode</p>
<p> "get" - http request mode</p>
<p class="highlight_red">The 'type' in zTree and jQuery's ajax is same.</p>
<p class="highlight_red">Both zTree and jQuery's this 'type' for ajax requests.</p>
</div>
<h3>Examples of setting</h3>
<h4>1. Set http request mode is 'get'</h4>
......
......@@ -11,13 +11,13 @@
</div>
<h3>String Format</h3>
<div class="desc">
<p>A url string(e.g. "http://www.domain.com"). Note: please ensure that the url can be loaded</p>
<p class="highlight_red">Url can also take parameters, please note that transcode.</p>
<p>A url string(e.g. "http://www.domain.com/cgi-bin/my-script.cgi"). Note: please check that the url can be loaded with a browser</p>
<p class="highlight_red">Url can also take parameters, please note that they need to be urlencoded.</p>
</div>
<h3>Function Parameter Descriptions</h3>
<div class="desc">
<h4><b>treeId</b><span>String</span></h4>
<p>zTree unique identifier: <b class="highlight_red">treeId</b>, easy for users to control.</p>
<p>zTree unique identifier: <b class="highlight_red">treeId</b>.</p>
<h4 class="topLine"><b>treeNode</b><span>JSON</span></h4>
<p>Parent node's JSON data object</p>
<p class="highlight_red">When asynchronously loading the root, the treeNode = null</p>
......
......@@ -5,29 +5,30 @@
<div class="desc">
<p></p>
<div class="longdesc">
<p>Used to capture the event before zTree execute ajax, zTree based on return value to determine whether to execute ajax.</p>
<p>This callback is made before zTree makes an ajax request, giving you an opportunity to decide if it should proceed or not.
Return false to prevent zTree from sending the ajax request.</p>
<p>Default: null</p>
</div>
</div>
<h3>Function Parameter Descriptions</h3>
<div class="desc">
<h4><b>treeId</b><span>String</span></h4>
<p>zTree unique identifier: <b class="highlight_red">treeId</b>, easy for users to control.</p>
<p>zTree unique identifier: <b class="highlight_red">treeId</b>.</p>
<h4 class="topLine"><b>treeNode</b><span>JSON</span></h4>
<p>JSON data object of the parent node</p>
<p class="highlight_red">When asynchronously loading the root, the treeNode = null</p>
<p class="highlight_red">When asynchronously loading the root, treeNode = null</p>
<h4 class="topLine"><b>Return </b><span>Boolean</span></h4>
<p>return true or false</p>
<p class="highlight_red">If return false, zTree will not execute ajax, and will not trigger the 'onAsyncSuccess / onAsyncError' callback.</p>
<p class="highlight_red">If the function returns false, zTree will not send the ajax request, and will not trigger the 'onAsyncSuccess / onAsyncError' callback.</p>
</div>
<h3>Examples of setting & function</h3>
<h4>1. If the parent node's attribute 'id' is 1, zTree will not execute ajax.</h4>
<pre xmlns=""><code>function zTreeBeforeAsync(treeId, treeNode) {
<h4>1. If the parent node's attribute 'id' is 1, don't send the ajax request.</h4>
<pre xmlns=""><code>function myBeforeCallBack(treeId, treeNode) {
return (treeNode.id !== 1);
};
var setting = {
callback: {
beforeAsync: zTreeBeforeAsync
beforeAsync: myBeforeCallBack
}
};
......</code></pre>
......
......@@ -5,28 +5,28 @@
<div class="desc">
<p></p>
<div class="longdesc">
<p>Used to capture the event before check or uncheck node, zTree based on return value to determine whether to change check state.</p>
<p>Callback before checking or unchecking a node, A false return value from the callback will prevent any change in the checked state.</p>
<p>Default: null</p>
</div>
</div>
<h3>Function Parameter Descriptions</h3>
<div class="desc">
<h4><b>treeId</b><span>String</span></h4>
<p>zTree unique identifier: <b class="highlight_red">treeId</b>, easy for users to control.</p>
<p>zTree unique identifier: <b class="highlight_red">treeId</b>.</p>
<h4 class="topLine"><b>treeNode</b><span>JSON</span></h4>
<p>JSON data object of the node which is checked or unchecked</p>
<h4 class="topLine"><b>Return </b><span>Boolean</span></h4>
<p>return true or false</p>
<p class="highlight_red">If return false, zTree will not change check state, and will not trigger the 'onCheck' callback.</p>
<p class="highlight_red">If return false, zTree will not change the checkbox state, and will not trigger the 'onCheck' callback.</p>
</div>
<h3>Examples of setting & function</h3>
<h4>1. disable to change check state of all nodes, and keep the check state initialization</h4>
<pre xmlns=""><code>function zTreeBeforeCheck(treeId, treeNode) {
<h4>1. This example returns false, preventing all checkboxes in the tree from toggling.</h4>
<pre xmlns=""><code>function myBeforeCheckCallBack(treeId, treeNode) {
return false;
};
var setting = {
callback: {
beforeCheck: zTreeBeforeCheck
beforeCheck: myBeforeCheckCallBack
}
};
......</code></pre>
......
......@@ -5,14 +5,14 @@
<div class="desc">
<p></p>
<div class="longdesc">
<p>Used to capture the event before click node, zTree based on return value to determine whether to trigger the 'onClick' callback.</p>
<p>Before click callback, return false to prevent the 'onClick' callback.</p>
<p>Default: null</p>
</div>
</div>
<h3>Function Parameter Descriptions</h3>
<div class="desc">
<h4><b>treeId</b><span>String</span></h4>
<p>zTree unique identifier: <b class="highlight_red">treeId</b>, easy for users to control.</p>
<p>zTree unique identifier: <b class="highlight_red">treeId</b>.</p>
<h4 class="topLine"><b>treeNode</b><span>JSON</span></h4>
<p>JSON data object of the node which is clicked</p>
<h4 class="topLine"><b>clickFlag</b><span>Number</span></h4>
......@@ -36,12 +36,12 @@
</div>
<h3>Examples of setting & function</h3>
<h4>1. disabled to click the node</h4>
<pre xmlns=""><code>function zTreeBeforeClick(treeId, treeNode, clickFlag) {
<pre xmlns=""><code>function myBeforeClick(treeId, treeNode, clickFlag) {
return (treeNode.id !== 1);
};
var setting = {
callback: {
beforeClick: zTreeBeforeClick
beforeClick: myBeforeClick
}
};
......</code></pre>
......
......@@ -5,28 +5,28 @@
<div class="desc">
<p></p>
<div class="longdesc">
<p>Used to capture the event before collapse node, zTree based on return value to determine whether to collapse node.</p>
<p>Specify callback function to be called before collapse node, The return value controls the collapse node.</p>
<p>Default: null</p>
</div>
</div>
<h3>Function Parameter Descriptions</h3>
<div class="desc">
<h4><b>treeId</b><span>String</span></h4>
<p>zTree unique identifier: <b class="highlight_red">treeId</b>, easy for users to control.</p>
<p>zTree unique identifier: <b class="highlight_red">treeId</b>.</p>
<h4 class="topLine"><b>treeNode</b><span>JSON</span></h4>
<p>JSON data object of the node which will be collapsed</p>
<p>JSON data object of the node to be collapsed</p>
<h4 class="topLine"><b>Return </b><span>Boolean</span></h4>
<p>return true or false</p>
<p class="highlight_red">If return false, zTree will not collapse node, and will not trigger the 'onCollapse' callback.</p>
</div>
<h3>Examples of setting & function</h3>
<h4>1. disabled to collapse node which is expanded</h4>
<pre xmlns=""><code>function zTreeBeforeCollapse(treeId, treeNode) {
<pre xmlns=""><code>function myBeforeCollapse(treeId, treeNode) {
return false;
};
var setting = {
callback: {
beforeCollapse: zTreeBeforeCollapse
beforeCollapse: myBeforeCollapse
}
};
......</code></pre>
......
......@@ -5,30 +5,30 @@
<div class="desc">
<p></p>
<div class="longdesc">
<p>Used to capture the dblclick event before the 'onDblClick' callback, zTree based on return value to determine whether to trigger the 'onDblClick' callback.</p>
<p>Specify callback function, executed before the 'onDblClick' callback, The return value controls the 'onDblClick' callback.</p>
<p>Default: null</p>
</div>
</div>
<h3>Function Parameter Descriptions</h3>
<div class="desc">
<h4><b>treeId</b><span>String</span></h4>
<p>zTree unique identifier: <b class="highlight_red">treeId</b>, easy for users to control.</p>
<p>zTree unique identifier: <b class="highlight_red">treeId</b>.</p>
<h4 class="topLine"><b>treeNode</b><span>JSON</span></h4>
<p>JSON data object of the node which is double clicked</p>
<p class="highlight_red">If the DOM which dblclicked isn't a node, it will return null.</p>
<h4 class="topLine"><b>Return </b><span>Boolean</span></h4>
<p>return true or false</p>
<p class="highlight_red">If return false, ztree will not trigger the 'onDblClick' callback, no effect on other operations.</p>
<p class="highlight_red">This callback function does not affect the dblclick the parent node to auto expand, please refer to setting.view.dblClickExpand properties.</p>
<p class="highlight_red">This callback function does not affect the auto expand of the parent node , please refer to setting.view.dblClickExpand properties.</p>
</div>
<h3>Examples of setting & function</h3>
<h4>1. disable to trigger the 'onDblClick' callback</h4>
<pre xmlns=""><code>function zTreeBeforeDblClick(treeId, treeNode) {
<pre xmlns=""><code>function myBeforeDblClick(treeId, treeNode) {
return false;
};
var setting = {
callback: {
beforeDblClick: zTreeBeforeDblClick
beforeDblClick: myBeforeDblClick
}
};
......</code></pre>
......
......@@ -5,25 +5,25 @@
<div class="desc">
<p></p>
<div class="longdesc">
<p>Used to capture the event before drag node, zTree based on return value to determine whether to start to drag node.</p>
<p>Specify callback function to be called before the drag node callback, The return value controls whether the drag node callback will execute.</p>
<p>Default: null</p>
</div>
</div>
<h3>Function Parameter Descriptions</h3>
<div class="desc">
<h4><b>treeId</b><span>String</span></h4>
<p>zTree unique identifier: <b class="highlight_red">treeId</b>, the tree is what the treeNodes are belong to, easy for users to control.</p>
<p>zTree unique identifier: <b class="highlight_red">treeId</b>, the id of the containing tree.</p>
<h4 class="topLine"><b>treeNodes</b><span>Array(JSON)</span></h4>
<p>A collection of the nodes which will be dragged</p>
<p class="highlight_red">v3.x allows drag and drop multiple sibling nodes, so this parameter is modified to Array(JSON).</p>
<p class="highlight_red">If the selected nodes aren't the sibling nodes, you can only drag one node which mouse over.</p>
<p>A collection of the nodes being dragged</p>
<p class="highlight_red">v3.x allows the drag and drop of multiple sibling nodes, so this parameter's type is changed to Array(JSON).</p>
<p class="highlight_red">If the selected nodes aren't sibling nodes, you can only drag one node.</p>
<h4 class="topLine"><b>Return </b><span>Boolean</span></h4>
<p>return true or false</p>
<p class="highlight_red">If return false, zTree will stop drag, and will not trigger the 'onDrag / beforeDrop / onDrop' callback.</p>
<p class="highlight_red">If return false, zTree will abort the drag and drop, and will not trigger the 'onDrag / beforeDrop / onDrop' sequence of callbacks.</p>
</div>
<h3>Examples of setting & function</h3>
<h4>1. disable to drag all node</h4>
<pre xmlns=""><code>function zTreeBeforeDrag(treeId, treeNodes) {
<h4>1. disable drag completely (by returning false)</h4>
<pre xmlns=""><code>function myBeforeDrag(treeId, treeNodes) {
return false;
};
var setting = {
......@@ -31,7 +31,7 @@ var setting = {
enable: true
},
callback: {
beforeDrag: zTreeBeforeDrag
beforeDrag: myBeforeDrag
}
};
......</code></pre>
......
......@@ -5,14 +5,14 @@
<div class="desc">
<p></p>
<div class="longdesc">
<p>Used to capture the event when drag node to collapsed parent node, zTree based on return value to determine whether to auto expand parent node.</p>
<p>Callback executed before drag node to collapsed parent node, The return value controls the auto expand behaviour of the parent node.</p>
<p>Default: null</p>
</div>
</div>
<h3>Function Parameter Descriptions</h3>
<div class="desc">
<h4><b>treeId</b><span>String</span></h4>
<p>zTree unique identifier: <b class="highlight_red">treeId</b>, the tree is what the treeNode(parent node) is belong to, easy for users to control.</p>
<p>zTree unique identifier: <b class="highlight_red">treeId</b>, the tree is what the treeNode(parent node) is belong to.</p>
<h4 class="topLine"><b>treeNode</b><span>JSON</span></h4>
<p>JSON data object of the parent node which will be auto expanded</p>
<h4 class="topLine"><b>Return </b><span>Boolean</span></h4>
......@@ -21,7 +21,7 @@
</div>
<h3>Examples of setting & function</h3>
<h4>1. disable to auto expand parent node.</h4>
<pre xmlns=""><code>function zTreeBeforeDragOpen(treeId, treeNode) {
<pre xmlns=""><code>function myBeforeDragOpen(treeId, treeNode) {
return false;
};
var setting = {
......@@ -29,7 +29,7 @@ var setting = {
enable: true
},
callback: {
beforeDragOpen: zTreeBeforeDragOpen
beforeDragOpen: myBeforeDragOpen
}
};
......</code></pre>
......
......@@ -5,28 +5,28 @@
<div class="desc">
<p></p>
<div class="longdesc">
<p>Used to capture the event before drag-drop node, zTree based on return value to determine whether to allow drag-drop node.</p>
<p>Specify callback function to be called before drag-drop of a node, The return value controls the execution of drag-drop callback.</p>
<p>Default: null</p>
<p class="highlight_red">When drop the nodes, if the dragged nodes is not in a valid location, this callback will not triggered, and will restore the original position.</p>
<p class="highlight_red">When a node is dropped, if the drop is not in a valid location, this callback will not be triggered, and will revert to the original position.</p>
</div>
</div>
<h3>Function Parameter Descriptions</h3>
<div class="desc">
<h4><b>treeId</b><span>String</span></h4>
<p>zTree unique identifier: <b class="highlight_red">treeId</b>, the tree is what the targetNode is belong to, easy for users to control.</p>
<p>zTree unique identifier: <b class="highlight_red">treeId</b>, the id of the containing tree.</p>
<h4 class="topLine"><b>treeNodes</b><span>Array(JSON)</span></h4>
<p>A collection of the nodes which has been dragged</p>
<p class="highlight_red">The treeNodes are the data of the nodes which has been dragged, when copy nodes or move nodes.</p>
<p class="highlight_red">The treeNodes which have been dragged, when copying nodes or moving nodes.</p>
<h4 class="topLine"><b>targetNode</b><span>JSON</span></h4>
<p>JSON data object of the target node which treeNodes are drag-dropped.</p>
<p class="highlight_red">If the treeNodes will be root node, the targetNode = null</p>
<p>JSON data object of the destination node on which treeNodes are being dropped.</p>
<p class="highlight_red">If the treeNodes is the root node, the targetNode = null</p>
<h4 class="topLine"><b>moveType</b><span>String</span></h4>
<p>the relative position of move to the target node</p>
<p class="highlight_red">"inner": will be child of targetNode</p>
<p class="highlight_red">"prev": will be sibling node, and be in front of targetNode</p>
<p class="highlight_red">"next": will be sibling node, and be behind targetNode</p>
<h4 class="topLine"><b>isCopy</b><span>Boolean</span></h4>
<p>the flag used to judge copy node or move node</p>
<p>the flag used to determine if the drop is to copy or move the node</p>
<p class="highlight_red">true: copy node; false: move node</p>
<h4 class="topLine"><b>Return </b><span>Boolean</span></h4>
<p>return true or false</p>
......@@ -34,7 +34,7 @@
</div>
<h3>Examples of setting & function</h3>
<h4>1. disable to drag nodes to root</h4>
<pre xmlns=""><code>function zTreeBeforeDrop(treeId, treeNodes, targetNode, moveType) {
<pre xmlns=""><code>function myBeforeDrop(treeId, treeNodes, targetNode, moveType) {
return !(targetNode == null || (moveType != "inner" && !targetNode.parentTId));
};
var setting = {
......@@ -42,7 +42,7 @@ var setting = {
enable: true
},
callback: {
beforeDrop: zTreeBeforeDrop
beforeDrop: myBeforeDrop
}
};
......</code></pre>
......
......@@ -5,24 +5,24 @@
<div class="desc">
<p></p>
<div class="longdesc">
<p>Used to capture the event before click edit button, zTree based on return value to determine whether to allow to edit the name.</p>
<p class="highlight_red">This callback is used to capture the event which edit button is clicked, then trigger the custom editing operation.</p>
<p>Specify callback function to be called before click edit button, The return value controls the editing of the name.</p>
<p class="highlight_red">This callback is fired when the edit button is clicked, to control the custom editing operation.</p>
<p>Default: null</p>
</div>
</div>
<h3>Function Parameter Descriptions</h3>
<div class="desc">
<h4><b>treeId</b><span>String</span></h4>
<p>zTree unique identifier: <b class="highlight_red">treeId</b>, easy for users to control.</p>
<p>zTree unique identifier: <b class="highlight_red">treeId</b>.</p>
<h4 class="topLine"><b>treeNode</b><span>JSON</span></h4>
<p>JSON data object of the node which will be edited name.</p>
<p>JSON data object of the node to be edited.</p>
<h4 class="topLine"><b>Return </b><span>Boolean</span></h4>
<p>return true or false</p>
<p class="highlight_red">If return false, the node will not be able to edit the name.</p>
<p class="highlight_red">If return false, allow editing of the name.</p>
</div>
<h3>Examples of setting & function</h3>
<h4>1. disable to edit the parent node's name</h4>
<pre xmlns=""><code>function zTreeBeforeEditName(treeId, treeNode) {
<h4>1. disable editing of any parent node's name</h4>
<pre xmlns=""><code>function myBeforeEditName(treeId, treeNode) {
return !treeNode.isParent;
}
var setting = {
......@@ -30,7 +30,7 @@ var setting = {
enable: true
},
callback: {
beforeEditName: zTreeBeforeEditName
beforeEditName: myBeforeEditName
}
};
......</code></pre>
......
......@@ -5,28 +5,28 @@
<div class="desc">
<p></p>
<div class="longdesc">
<p>Used to capture the event before expand node, zTree based on return value to determine whether to expand node.</p>
<p>Specify callback function to be called before expanding a node, The return value controls the expand node callback.</p>
<p>Default: null</p>
</div>
</div>
<h3>Function Parameter Descriptions</h3>
<div class="desc">
<h4><b>treeId</b><span>String</span></h4>
<p>zTree unique identifier: <b class="highlight_red">treeId</b>, easy for users to control.</p>
<p>zTree unique identifier: <b class="highlight_red">treeId</b>.</p>
<h4 class="topLine"><b>treeNode</b><span>JSON</span></h4>
<p>JSON data object of the node which will be expanded</p>
<p>JSON data object of the node to be expanded</p>
<h4 class="topLine"><b>Return </b><span>Boolean</span></h4>
<p>return true or false</p>
<p class="highlight_red">If return false, zTree will not expand node, and will not trigger the 'onExpand' callback.</p>
</div>
<h3>Examples of setting & function</h3>
<h4>1. disabled to expand node which is collapsed</h4>
<pre xmlns=""><code>function zTreeBeforeExpand(treeId, treeNode) {
<h4>1. disables expanding of all nodes</h4>
<pre xmlns=""><code>function myBeforeExpand(treeId, treeNode) {
return false;
};
var setting = {
callback: {
beforeExpand: zTreeBeforeExpand
beforeExpand: myBeforeExpand
}
};
......</code></pre>
......
......@@ -5,14 +5,14 @@
<div class="desc">
<p></p>
<div class="longdesc">
<p>Used to capture the mousedown event before the 'onMouseDown' callback, zTree based on return value to determine whether to trigger the 'onMouseDown' callback.</p>
<p>Specify callback function, executed before the 'onMouseDown' callback, The return value controls the 'onMouseDown' callback.</p>
<p>Default: null</p>
</div>
</div>
<h3>Function Parameter Descriptions</h3>
<div class="desc">
<h4><b>treeId</b><span>String</span></h4>
<p>zTree unique identifier: <b class="highlight_red">treeId</b>, easy for users to control.</p>
<p>zTree unique identifier: <b class="highlight_red">treeId</b>.</p>
<h4 class="topLine"><b>treeNode</b><span>JSON</span></h4>
<p>JSON data object of the node which mouse over</p>
<p class="highlight_red">If the DOM which mouse over isn't a node, it will return null.</p>
......@@ -22,12 +22,12 @@
</div>
<h3>Examples of setting & function</h3>
<h4>1. disable to trigger the 'onMouseDown' callback</h4>
<pre xmlns=""><code>function zTreeBeforeMouseDown(treeId, treeNode) {
<pre xmlns=""><code>function myBeforeMouseDown(treeId, treeNode) {
return false;
};
var setting = {
callback: {
beforeMouseDown: zTreeBeforeMouseDown
beforeMouseDown: myBeforeMouseDown
}
};
......</code></pre>
......
......@@ -5,14 +5,14 @@
<div class="desc">
<p></p>
<div class="longdesc">
<p>Used to capture the mouseup event before the 'onMouseUp' callback, zTree based on return value to determine whether to trigger the 'onMouseUp' callback.</p>
<p>Specify callback function, executed before the 'onMouseUp' callback, The return value controls the 'onMouseUp' callback.</p>
<p>Default: null</p>
</div>
</div>
<h3>Function Parameter Descriptions</h3>
<div class="desc">
<h4><b>treeId</b><span>String</span></h4>
<p>zTree unique identifier: <b class="highlight_red">treeId</b>, easy for users to control.</p>
<p>zTree unique identifier: <b class="highlight_red">treeId</b>.</p>
<h4 class="topLine"><b>treeNode</b><span>JSON</span></h4>
<p>JSON data object of the node which mouse over</p>
<p class="highlight_red">If the DOM which mouse over isn't a node, it will return null.</p>
......@@ -22,12 +22,12 @@
</div>
<h3>Examples of setting & function</h3>
<h4>1. disable to trigger the 'onMouseUp' callback</h4>
<pre xmlns=""><code>function zTreeBeforeMouseUp(treeId, treeNode) {
<pre xmlns=""><code>function myBeforeMouseUp(treeId, treeNode) {
return false;
};
var setting = {
callback: {
beforeMouseUp: zTreeBeforeMouseUp
beforeMouseUp: myBeforeMouseUp
}
};
......</code></pre>
......
......@@ -5,23 +5,23 @@
<div class="desc">
<p></p>
<div class="longdesc">
<p>Used to capture the event before remove node, zTree based on return value to determine whether to allow to remove node.</p>
<p>Specify callback function to be called before remove node, The return value controls the allow to remove node.</p>
<p>Default: null</p>
</div>
</div>
<h3>Function Parameter Descriptions</h3>
<div class="desc">
<h4><b>treeId</b><span>String</span></h4>
<p>zTree unique identifier: <b class="highlight_red">treeId</b>, easy for users to control.</p>
<p>zTree unique identifier: <b class="highlight_red">treeId</b>.</p>
<h4 class="topLine"><b>treeNode</b><span>JSON</span></h4>
<p>JSON data object of the node which will be removed.</p>
<p>JSON data object of the node to be removed.</p>
<h4 class="topLine"><b>Return </b><span>Boolean</span></h4>
<p>return true or false</p>
<p class="highlight_red">If return false, zTree will not remove node, and will not trigger the 'onRemove' callback.</p>
</div>
<h3>Examples of setting & function</h3>
<h4>1. disable to remove node</h4>
<pre xmlns=""><code>function zTreeBeforeRemove(treeId, treeNode) {
<pre xmlns=""><code>function myBeforeRemove(treeId, treeNode) {
return false;
}
var setting = {
......@@ -29,7 +29,7 @@ var setting = {
enable: true
},
callback: {
beforeRemove: zTreeBeforeRemove
beforeRemove: myBeforeRemove
}
};
......</code></pre>
......
......@@ -5,7 +5,7 @@
<div class="desc">
<p></p>
<div class="longdesc">
<p>Used to capture the event before rename(when input DOM blur or press Enter Key), zTree based on return value to determine whether to allow to rename node.</p>
<p>Specify callback function to be called before rename(when input DOM blur or press Enter Key), The return value controls the allow to rename node.</p>
<p class="highlight_red">When node is editing name, press the ESC key to restore the original name and stop edit name.</p>
<p class="highlight_red">From v3.5.13, zTree will trigger this callback when user cancel edit name. please see 'isCancel' parameter.</p>
<p>Default: null</p>
......@@ -14,9 +14,9 @@
<h3>Function Parameter Descriptions</h3>
<div class="desc">
<h4><b>treeId</b><span>String</span></h4>
<p>zTree unique identifier: <b class="highlight_red">treeId</b>, easy for users to control.</p>
<p>zTree unique identifier: <b class="highlight_red">treeId</b>.</p>
<h4 class="topLine"><b>treeNode</b><span>JSON</span></h4>
<p>JSON data object of the node which will be rename.</p>
<p>JSON data object of the node to be rename.</p>
<h4 class="topLine"><b>newName</b><span>String</span></h4>
<p>the new name</p>
<h4 class="topLine"><b>isCancel</b><span>Boolean</span></h4>
......@@ -30,7 +30,7 @@
</div>
<h3>Examples of setting & function</h3>
<h4>1. the length of the new name can't less than 5</h4>
<pre xmlns=""><code>function zTreeBeforeRename(treeId, treeNode, newName, isCancel) {
<pre xmlns=""><code>function myBeforeRename(treeId, treeNode, newName, isCancel) {
return newName.length > 5;
}
var setting = {
......@@ -38,7 +38,7 @@ var setting = {
enable: true
},
callback: {
beforeRename: zTreeBeforeRename
beforeRename: myBeforeRename
}
};
......</code></pre>
......
......@@ -5,14 +5,14 @@
<div class="desc">
<p></p>
<div class="longdesc">
<p>Used to capture the right click event before the 'onRightClick' callback, zTree based on return value to determine whether to trigger the 'onRightClick' callback.</p>
<p>Used to capture the right click event before the 'onRightClick' callback, The return value controls the 'onRightClick' callback.</p>
<p>Default: null</p>
</div>
</div>
<h3>Function Parameter Descriptions</h3>
<div class="desc">
<h4><b>treeId</b><span>String</span></h4>
<p>zTree unique identifier: <b class="highlight_red">treeId</b>, easy for users to control.</p>
<p>zTree unique identifier: <b class="highlight_red">treeId</b>.</p>
<h4 class="topLine"><b>treeNode</b><span>JSON</span></h4>
<p>JSON data object of the node which is mouse right clicked</p>
<p class="highlight_red">If the DOM which mouse right clicked isn't a node, it will return null.</p>
......@@ -22,12 +22,12 @@
</div>
<h3>Examples of setting & function</h3>
<h4>1. disable to trigger the 'onRightClick' callback</h4>
<pre xmlns=""><code>function zTreeBeforeRightClick(treeId, treeNode) {
<pre xmlns=""><code>function myBeforeRightClick(treeId, treeNode) {
return false;
};
var setting = {
callback: {
beforeRightClick: zTreeBeforeRightClick
beforeRightClick: myBeforeRightClick
}
};
......</code></pre>
......
......@@ -16,7 +16,7 @@
<h4><b>event</b><span>js event Object</span></h4>
<p>event Object</p>
<h4 class="topLine"><b>treeId</b><span>String</span></h4>
<p>zTree unique identifier: <b class="highlight_red">treeId</b>, easy for users to control.</p>
<p>zTree unique identifier: <b class="highlight_red">treeId</b>.</p>
<h4 class="topLine"><b>treeNode</b><span>JSON</span></h4>
<p>JSON data object of the parent node</p>
<p class="highlight_red">When load root nodes, treeNode = null</p>
......@@ -29,12 +29,12 @@
</div>
<h3>Examples of setting & function</h3>
<h4>1. When execute ajax make error, alert message.</h4>
<pre xmlns=""><code>function zTreeOnAsyncError(event, treeId, treeNode, XMLHttpRequest, textStatus, errorThrown) {
<pre xmlns=""><code>function myOnAsyncError(event, treeId, treeNode, XMLHttpRequest, textStatus, errorThrown) {
alert(XMLHttpRequest);
};
var setting = {
callback: {
onAsyncError: zTreeOnAsyncError
onAsyncError: myOnAsyncError
}
};
......</code></pre>
......
......@@ -15,7 +15,7 @@
<h4><b>event</b><span>js event Object</span></h4>
<p>event Object</p>
<h4 class="topLine"><b>treeId</b><span>String</span></h4>
<p>zTree unique identifier: <b class="highlight_red">treeId</b>, easy for users to control.</p>
<p>zTree unique identifier: <b class="highlight_red">treeId</b>.</p>
<h4 class="topLine"><b>treeNode</b><span>JSON</span></h4>
<p>JSON data object of the parent node</p>
<p class="highlight_red">When load root nodes, treeNode = null</p>
......@@ -25,12 +25,12 @@
</div>
<h3>Examples of setting & function</h3>
<h4>1. When execute ajax complete success, alert message.</h4>
<pre xmlns=""><code>function zTreeOnAsyncSuccess(event, treeId, treeNode, msg) {
<pre xmlns=""><code>function myOnAsyncSuccess(event, treeId, treeNode, msg) {
alert(msg);
};
var setting = {
callback: {
onAsyncSuccess: zTreeOnAsyncSuccess
onAsyncSuccess: myOnAsyncSuccess
}
};
......</code></pre>
......
......@@ -15,18 +15,18 @@
<h4><b>event</b><span>js event Object</span></h4>
<p>event Object</p>
<h4 class="topLine"><b>treeId</b><span>String</span></h4>
<p>zTree unique identifier: <b class="highlight_red">treeId</b>, easy for users to control.</p>
<p>zTree unique identifier: <b class="highlight_red">treeId</b>.</p>
<h4 class="topLine"><b>treeNode</b><span>JSON</span></h4>
<p>JSON data object of the node which is checked or unchecked</p>
</div>
<h3>Examples of setting & function</h3>
<h4>1. When check or uncheck the checkbox and radio, alert info about 'tId' and 'name' and 'checked'.</h4>
<pre xmlns=""><code>function zTreeOnCheck(event, treeId, treeNode) {
<pre xmlns=""><code>function myOnCheck(event, treeId, treeNode) {
alert(treeNode.tId + ", " + treeNode.name + "," + treeNode.checked);
};
var setting = {
callback: {
onCheck: zTreeOnCheck
onCheck: myOnCheck
}
};
......</code></pre>
......
......@@ -15,7 +15,7 @@
<h4><b>event</b><span>js event Object</span></h4>
<p>event Object</p>
<h4 class="topLine"><b>treeId</b><span>String</span></h4>
<p>zTree unique identifier: <b class="highlight_red">treeId</b>, easy for users to control.</p>
<p>zTree unique identifier: <b class="highlight_red">treeId</b>.</p>
<h4 class="topLine"><b>treeNode</b><span>JSON</span></h4>
<p>JSON data object of the node which is clicked</p>
<h4 class="topLine"><b>clickFlag</b><span>Number</span></h4>
......@@ -36,12 +36,12 @@
</div>
<h3>Examples of setting & function</h3>
<h4>1. When click node, alert info about 'tId' and 'name'.</h4>
<pre xmlns=""><code>function zTreeOnClick(event, treeId, treeNode) {
<pre xmlns=""><code>function myOnClick(event, treeId, treeNode) {
alert(treeNode.tId + ", " + treeNode.name);
};
var setting = {
callback: {
onClick: zTreeOnClick
onClick: myOnClick
}
};
......</code></pre>
......
......@@ -5,7 +5,7 @@
<div class="desc">
<p></p>
<div class="longdesc">
<p>Used to capture the event when collapse node.</p>
<p>Callback for collapse node.</p>
<p class="highlight_red">If you set 'setting.callback.beforeCollapse',and return false, zTree will not collapse node, and will not trigger the 'onCollapse' callback.</p>
<p>Default: null</p>
</div>
......@@ -15,18 +15,18 @@
<h4><b>event</b><span>js event Object</span></h4>
<p>event Object</p>
<h4 class="topLine"><b>treeId</b><span>String</span></h4>
<p>zTree unique identifier: <b class="highlight_red">treeId</b>, easy for users to control.</p>
<p>zTree unique identifier: <b class="highlight_red">treeId</b>.</p>
<h4 class="topLine"><b>treeNode</b><span>JSON</span></h4>
<p>JSON data object of the node which will be collapsed</p>
<p>JSON data object of the node to be collapsed</p>
</div>
<h3>Examples of setting & function</h3>
<h4>1. When collapse node, alert info about 'tId' and 'name'.</h4>
<pre xmlns=""><code>function zTreeOnCollapse(event, treeId, treeNode) {
<pre xmlns=""><code>function myOnCollapse(event, treeId, treeNode) {
alert(treeNode.tId + ", " + treeNode.name);
};
var setting = {
callback: {
onCollapse: zTreeOnCollapse
onCollapse: myOnCollapse
}
};
......</code></pre>
......
......@@ -15,19 +15,19 @@
<h4><b>event</b><span>js event Object</span></h4>
<p>event Object</p>
<h4 class="topLine"><b>treeId</b><span>String</span></h4>
<p>zTree unique identifier: <b class="highlight_red">treeId</b>, easy for users to control.</p>
<p>zTree unique identifier: <b class="highlight_red">treeId</b>.</p>
<h4 class="topLine"><b>treeNode</b><span>JSON</span></h4>
<p>JSON data object of the node which is double clicked</p>
<p class="highlight_red">If the DOM which dblclicked isn't a node, it will return null.</p>
</div>
<h3>Examples of setting & function</h3>
<h4>1. When double click node, alert info about 'tId' and 'name'.</h4>
<pre xmlns=""><code>function zTreeOnDblClick(event, treeId, treeNode) {
<pre xmlns=""><code>function myOnDblClick(event, treeId, treeNode) {
alert(treeNode ? treeNode.tId + ", " + treeNode.name : "isRoot");
};
var setting = {
callback: {
onDblClick: zTreeOnDblClick
onDblClick: myOnDblClick
}
};
......</code></pre>
......
......@@ -15,18 +15,18 @@
<h4><b>event</b><span>js event Object</span></h4>
<p>event Object</p>
<h4 class="topLine"><b>treeId</b><span>String</span></h4>
<p>zTree unique identifier: <b class="highlight_red">treeId</b>, the tree is what the treeNodes are belong to, easy for users to control.</p>
<p>zTree unique identifier: <b class="highlight_red">treeId</b>, the id of the containing tree.</p>
<h4 class="topLine"><b>treeNodes</b><span>Array(JSON)</span></h4>
<p>A collection of the nodes which will be dragged</p>
</div>
<h3>Examples of setting & function</h3>
<h4>1. When drag nodes, alert the number of dragged nodes.</h4>
<pre xmlns=""><code>function zTreeOnDrag(event, treeId, treeNodes) {
<pre xmlns=""><code>function myOnDrag(event, treeId, treeNodes) {
alert(treeNodes.length);
};
var setting = {
callback: {
onDrag: zTreeOnDrag
onDrag: myOnDrag
}
};
......</code></pre>
......
......@@ -15,18 +15,18 @@
<h4><b>event</b><span>js event Object</span></h4>
<p>event Object</p>
<h4 class="topLine"><b>treeId</b><span>String</span></h4>
<p>zTree unique identifier: <b class="highlight_red">treeId</b>, the tree is what the treeNodes are belong to, easy for users to control.</p>
<p>zTree unique identifier: <b class="highlight_red">treeId</b>, the id of the containing tree.</p>
<h4 class="topLine"><b>treeNodes</b><span>Array(JSON)</span></h4>
<p>A collection of the nodes which will be dragged</p>
</div>
<h3>Examples of setting & function</h3>
<h4>1. When drag nodes, output the target dom.</h4>
<pre xmlns=""><code>function zTreeOnDragMove(event, treeId, treeNodes) {
<pre xmlns=""><code>function myOnDragMove(event, treeId, treeNodes) {
console.log(event.target);
};
var setting = {
callback: {
onDragMove: zTreeOnDragMove
onDragMove: myOnDragMove
}
};
......</code></pre>
......
......@@ -15,7 +15,7 @@
<h4><b>event</b><span>js event Object</span></h4>
<p>event Object</p>
<h4 class="topLine"><b>treeId</b><span>String</span></h4>
<p>zTree unique identifier: <b class="highlight_red">treeId</b>, the tree is what the targetNode is belong to, easy for users to control.</p>
<p>zTree unique identifier: <b class="highlight_red">treeId</b>, the id of the containing tree.</p>
<h4 class="topLine"><b>treeNodes</b><span>Array(JSON)</span></h4>
<p>A collection of the nodes which has been dragged</p>
<p class="highlight_red">The treeNodes are the data of the nodes which be dragged, when move nodes.</p>
......@@ -35,12 +35,12 @@
</div>
<h3>Examples of setting & function</h3>
<h4>1. When drag-drop nodes complete, alert the number of dragged nodes and info about targetNode.</h4>
<pre xmlns=""><code>function zTreeOnDrop(event, treeId, treeNodes, targetNode, moveType) {
<pre xmlns=""><code>function myOnDrop(event, treeId, treeNodes, targetNode, moveType) {
alert(treeNodes.length + "," + (targetNode ? (targetNode.tId + ", " + targetNode.name) : "isRoot" ));
};
var setting = {
callback: {
onDrop: zTreeOnDrop
onDrop: myOnDrop
}
};
......</code></pre>
......
......@@ -5,7 +5,7 @@
<div class="desc">
<p></p>
<div class="longdesc">
<p>Used to capture the event when expand node.</p>
<p>Callback for expand node.</p>
<p class="highlight_red">If you set 'setting.callback.beforeExpand',and return false, zTree will not expand node, and will not trigger the 'onExpand' callback.</p>
<p>Default: null</p>
</div>
......@@ -15,18 +15,18 @@
<h4><b>event</b><span>js event Object</span></h4>
<p>event Object</p>
<h4 class="topLine"><b>treeId</b><span>String</span></h4>
<p>zTree unique identifier: <b class="highlight_red">treeId</b>, easy for users to control.</p>
<p>zTree unique identifier: <b class="highlight_red">treeId</b>.</p>
<h4 class="topLine"><b>treeNode</b><span>JSON</span></h4>
<p>JSON data object of the node which will be expanded</p>
<p>JSON data object of the node to be expanded</p>
</div>
<h3>Examples of setting & function</h3>
<h4>1. When expand node, alert info about 'tId' and 'name'.</h4>
<pre xmlns=""><code>function zTreeOnExpand(event, treeId, treeNode) {
<pre xmlns=""><code>function myOnExpand(event, treeId, treeNode) {
alert(treeNode.tId + ", " + treeNode.name);
};
var setting = {
callback: {
onExpand: zTreeOnExpand
onExpand: myOnExpand
}
};
......</code></pre>
......
......@@ -5,7 +5,7 @@
<div class="desc">
<p></p>
<div class="longdesc">
<p>Used to capture the event when mouse down.</p>
<p>Callback for mouse down.</p>
<p class="highlight_red">If you set 'setting.callback.beforeMouseDown',and return false, zTree will not trigger the 'onMouseDown' callback.</p>
<p>Default: null</p>
</div>
......@@ -15,19 +15,19 @@
<h4><b>event</b><span>js event Object</span></h4>
<p>event Object</p>
<h4 class="topLine"><b>treeId</b><span>String</span></h4>
<p>zTree unique identifier: <b class="highlight_red">treeId</b>, easy for users to control.</p>
<p>zTree unique identifier: <b class="highlight_red">treeId</b>.</p>
<h4 class="topLine"><b>treeNode</b><span>JSON</span></h4>
<p>JSON data object of the node which mouse over</p>
<p class="highlight_red">If the DOM which mouse over isn't a node, it will return null.</p>
</div>
<h3>Examples of setting & function</h3>
<h4>1. When mouse down, alert info about 'tId' and 'name'.</h4>
<pre xmlns=""><code>function zTreeOnMouseDown(event, treeId, treeNode) {
<pre xmlns=""><code>function myOnMouseDown(event, treeId, treeNode) {
alert(treeNode ? treeNode.tId + ", " + treeNode.name : "isRoot");
};
var setting = {
callback: {
onMouseDown: zTreeOnMouseDown
onMouseDown: myOnMouseDown
}
};
......</code></pre>
......
......@@ -5,7 +5,7 @@
<div class="desc">
<p></p>
<div class="longdesc">
<p>Used to capture the event when mouse up.</p>
<p>Callback for mouse up.</p>
<p class="highlight_red">If you set 'setting.callback.beforeMouseUp',and return false, zTree will not trigger the 'onMouseUp' callback.</p>
<p>Default: null</p>
</div>
......@@ -15,19 +15,19 @@
<h4><b>event</b><span>js event Object</span></h4>
<p>event Object</p>
<h4 class="topLine"><b>treeId</b><span>String</span></h4>
<p>zTree unique identifier: <b class="highlight_red">treeId</b>, easy for users to control.</p>
<p>zTree unique identifier: <b class="highlight_red">treeId</b>.</p>
<h4 class="topLine"><b>treeNode</b><span>JSON</span></h4>
<p>JSON data object of the node which mouse over</p>
<p class="highlight_red">If the DOM which mouse over isn't a node, it will return null.</p>
</div>
<h3>Examples of setting & function</h3>
<h4>1. When mouse up, alert info about 'tId' and 'name'.</h4>
<pre xmlns=""><code>function zTreeOnMouseUp(event, treeId, treeNode) {
<pre xmlns=""><code>function myOnMouseUp(event, treeId, treeNode) {
alert(treeNode ? treeNode.tId + ", " + treeNode.name : "isRoot");
};
var setting = {
callback: {
onMouseUp: zTreeOnMouseUp
onMouseUp: myOnMouseUp
}
};
......</code></pre>
......
......@@ -5,7 +5,7 @@
<div class="desc">
<p></p>
<div class="longdesc">
<p>Used to capture the event when node's DOM is created.</p>
<p>Callback for node's DOM is created.</p>
<p class="highlight_red">Because v3.x uses lazy loading technology, so the nodes which doesn't create DOM when initialized will not trigger this callback, until its parent node is expanded.</p>
<p class="highlight_red">Large amount of data to load, please note: do not set onNodeCreated, can improve performance as when initialized.</p>
<p>Default: null</p>
......@@ -16,18 +16,18 @@
<h4><b>event</b><span>js event Object</span></h4>
<p>event Object</p>
<h4 class="topLine"><b>treeId</b><span>String</span></h4>
<p>zTree unique identifier: <b class="highlight_red">treeId</b>, easy for users to control.</p>
<p>zTree unique identifier: <b class="highlight_red">treeId</b>.</p>
<h4 class="topLine"><b>treeNode</b><span>JSON</span></h4>
<p>JSON data object of the node which DOM is created</p>
</div>
<h3>Examples of setting & function</h3>
<h4>1. When node's DOM is created, alert info about 'tId' and 'name'.</h4>
<pre xmlns=""><code>function zTreeOnNodeCreated(event, treeId, treeNode) {
<pre xmlns=""><code>function myOnNodeCreated(event, treeId, treeNode) {
alert(treeNode.tId + ", " + treeNode.name);
};
var setting = {
callback: {
onNodeCreated: zTreeOnNodeCreated
onNodeCreated: myOnNodeCreated
}
};
......</code></pre>
......
......@@ -5,7 +5,7 @@
<div class="desc">
<p></p>
<div class="longdesc">
<p>Used to capture the event when remove node.</p>
<p>Callback for remove node.</p>
<p class="highlight_red">If you set 'setting.callback.beforeRemove',and return false, zTree will not remove node, and will not trigger the 'onRemove' callback.</p>
<p>Default: null</p>
</div>
......@@ -15,18 +15,18 @@
<h4><b>event</b><span>js event Object</span></h4>
<p>event Object</p>
<h4 class="topLine"><b>treeId</b><span>String</span></h4>
<p>zTree unique identifier: <b class="highlight_red">treeId</b>, easy for users to control.</p>
<p>zTree unique identifier: <b class="highlight_red">treeId</b>.</p>
<h4 class="topLine"><b>treeNode</b><span>JSON</span></h4>
<p>JSON data object of the node which was removed.</p>
</div>
<h3>Examples of setting & function</h3>
<h4>1. When remove node, alert info about 'tId' and 'name'.</h4>
<pre xmlns=""><code>function zTreeOnRemove(event, treeId, treeNode) {
<pre xmlns=""><code>function myOnRemove(event, treeId, treeNode) {
alert(treeNode.tId + ", " + treeNode.name);
}
var setting = {
callback: {
onRemove: zTreeOnRemove
onRemove: myOnRemove
}
};
......</code></pre>
......
......@@ -5,9 +5,9 @@
<div class="desc">
<p></p>
<div class="longdesc">
<p>Used to capture the event when remove node.</p>
<p>Callback for remove node.</p>
<p class="highlight_red">1. If you set 'setting.callback.beforeRename',and return false, zTree will keep the editing name, and will not trigger the 'onRename' callback.</p>
<p class="highlight_red">2. If you modity treeNode data, and use 'updateNode' function, zTree will not trigger the 'onRename' callback.</p>
<p class="highlight_red">2. If you modify treeNode data, and use 'updateNode' function, zTree will not trigger the 'onRename' callback.</p>
<p class="highlight_red">3. From v3.5.13, zTree will trigger this callback when user cancel edit name. please see 'isCancel' parameter.</p>
<p>Default: null</p>
</div>
......@@ -17,7 +17,7 @@
<h4><b>event</b><span>js event Object</span></h4>
<p>event Object</p>
<h4 class="topLine"><b>treeId</b><span>String</span></h4>
<p>zTree unique identifier: <b class="highlight_red">treeId</b>, easy for users to control.</p>
<p>zTree unique identifier: <b class="highlight_red">treeId</b>.</p>
<h4 class="topLine"><b>treeNode</b><span>JSON</span></h4>
<p>JSON data object of the node which was rename.</p>
<h4 class="topLine"><b>isCancel</b><span>Boolean</span></h4>
......@@ -27,12 +27,12 @@
</div>
<h3>Examples of setting & function</h3>
<h4>1. When rename node, alert info about 'tId' and 'name'.</h4>
<pre xmlns=""><code>function zTreeOnRename(event, treeId, treeNode, isCancel) {
<pre xmlns=""><code>function myOnRename(event, treeId, treeNode, isCancel) {
alert(treeNode.tId + ", " + treeNode.name);
}
var setting = {
callback: {
onRename: zTreeOnRename
onRename: myOnRename
}
};
......</code></pre>
......
......@@ -5,7 +5,7 @@
<div class="desc">
<p></p>
<div class="longdesc">
<p>Used to capture the event when mouse right click node.</p>
<p>Callback for mouse right click node.</p>
<p class="highlight_red">If you set 'setting.callback.beforeRightClick',and return false, zTree will not trigger the 'onRightClick' callback.</p>
<p class="highlight_red">If you set 'setting.callback.onRightClick', zTree will shield the browser context menu when mouse right click on zTree.</p>
<p>Default: null</p>
......@@ -16,19 +16,19 @@
<h4><b>event</b><span>js event Object</span></h4>
<p>event Object</p>
<h4 class="topLine"><b>treeId</b><span>String</span></h4>
<p>zTree unique identifier: <b class="highlight_red">treeId</b>, easy for users to control.</p>
<p>zTree unique identifier: <b class="highlight_red">treeId</b>.</p>
<h4 class="topLine"><b>treeNode</b><span>JSON</span></h4>
<p>JSON data object of the node which is mouse right clicked</p>
<p class="highlight_red">If the DOM which mouse right clicked isn't a node, it will return null.</p>
</div>
<h3>Examples of setting & function</h3>
<h4>1. When mouse right click node, alert info about 'tId' and 'name'.</h4>
<pre xmlns=""><code>function zTreeOnRightClick(event, treeId, treeNode) {
<pre xmlns=""><code>function myOnRightClick(event, treeId, treeNode) {
alert(treeNode ? treeNode.tId + ", " + treeNode.name : "isRoot");
};
var setting = {
callback: {
onRightClick: zTreeOnRightClick
onRightClick: myOnRightClick
}
};
......</code></pre>
......
......@@ -19,7 +19,7 @@
<h3>Function Parameter Descriptions</h3>
<div class="desc">
<h4><b>treeId</b><span>String</span></h4>
<p>zTree unique identifier: <b class="highlight_red">treeId</b>, easy for users to control.</p>
<p>zTree unique identifier: <b class="highlight_red">treeId</b>.</p>
<h4 class="topLine"><b>treeNodes</b><span>Array(JSON)</span></h4>
<p>A collection of the nodes which has been dragged</p>
<h4 class="topLine"><b>targetNode</b><span>JSON</span></h4>
......
......@@ -19,7 +19,7 @@
<h3>Function Parameter Descriptions</h3>
<div class="desc">
<h4><b>treeId</b><span>String</span></h4>
<p>zTree unique identifier: <b class="highlight_red">treeId</b>, easy for users to control.</p>
<p>zTree unique identifier: <b class="highlight_red">treeId</b>.</p>
<h4 class="topLine"><b>treeNodes</b><span>Array(JSON)</span></h4>
<p>A collection of the nodes which has been dragged</p>
<h4 class="topLine"><b>targetNode</b><span>JSON</span></h4>
......
......@@ -19,7 +19,7 @@
<h3>Function Parameter Descriptions</h3>
<div class="desc">
<h4><b>treeId</b><span>String</span></h4>
<p>zTree unique identifier: <b class="highlight_red">treeId</b>, easy for users to control.</p>
<p>zTree unique identifier: <b class="highlight_red">treeId</b>.</p>
<h4 class="topLine"><b>treeNodes</b><span>Array(JSON)</span></h4>
<p>A collection of the nodes which has been dragged</p>
<h4 class="topLine"><b>targetNode</b><span>JSON</span></h4>
......
......@@ -16,7 +16,7 @@
<h3>Function Parameter Descriptions</h3>
<div class="desc">
<h4><b>treeId</b><span>String</span></h4>
<p>zTree unique identifier: <b class="highlight_red">treeId</b>, easy for users to control.</p>
<p>zTree unique identifier: <b class="highlight_red">treeId</b>.</p>
<h4 class="topLine"><b>treeNode</b><span>JSON</span></h4>
<p>JSON data object of the node which show the remove button</p>
<h4 class="topLine"><b>Return </b><span>String</span></h4>
......
......@@ -16,7 +16,7 @@
<h3>Function Parameter Descriptions</h3>
<div class="desc">
<h4><b>treeId</b><span>String</span></h4>
<p>zTree unique identifier: <b class="highlight_red">treeId</b>, easy for users to control.</p>
<p>zTree unique identifier: <b class="highlight_red">treeId</b>.</p>
<h4 class="topLine"><b>treeNode</b><span>JSON</span></h4>
<p>JSON data object of the node which show the rename button</p>
<h4 class="topLine"><b>Return </b><span>String</span></h4>
......
......@@ -20,7 +20,7 @@
<h3>Function Parameter Descriptions</h3>
<div class="desc">
<h4><b>treeId</b><span>String</span></h4>
<p>zTree unique identifier: <b class="highlight_red">treeId</b>, easy for users to control.</p>
<p>zTree unique identifier: <b class="highlight_red">treeId</b>.</p>
<h4 class="topLine"><b>treeNode</b><span>JSON</span></h4>
<p>JSON data object of the node which show the remove button</p>
<h4 class="topLine"><b>Return </b><span>Boolean</span></h4>
......
......@@ -22,7 +22,7 @@
<h3>Function Parameter Descriptions</h3>
<div class="desc">
<h4><b>treeId</b><span>String</span></h4>
<p>zTree unique identifier: <b class="highlight_red">treeId</b>, easy for users to control.</p>
<p>zTree unique identifier: <b class="highlight_red">treeId</b>.</p>
<h4 class="topLine"><b>treeNode</b><span>JSON</span></h4>
<p>JSON data object of the node which show the rename button</p>
<h4 class="topLine"><b>Return </b><span>Boolean</span></h4>
......
......@@ -14,7 +14,7 @@
<h3>Function Parameter Descriptions</h3>
<div class="desc">
<h4><b>treeId</b><span>String</span></h4>
<p>zTree unique identifier: <b class="highlight_red">treeId</b>, easy for users to control.</p>
<p>zTree unique identifier: <b class="highlight_red">treeId</b>.</p>
<h4 class="topLine"><b>treeNode</b><span>JSON</span></h4>
<p>JSON data object of the node which display the custom control.</p>
</div>
......
......@@ -13,7 +13,7 @@
<h3>Function Parameter Descriptions</h3>
<div class="desc">
<h4><b>treeId</b><span>String</span></h4>
<p>zTree unique identifier: <b class="highlight_red">treeId</b>, easy for users to control.</p>
<p>zTree unique identifier: <b class="highlight_red">treeId</b>.</p>
<h4 class="topLine"><b>treeNode</b><span>JSON</span></h4>
<p>JSON data object of the node which need to display the custom control.</p>
</div>
......
......@@ -17,7 +17,7 @@
<h3>Function Pamameter Descriptions</h3>
<div class="desc">
<h4><b>treeId</b><span>String</span></h4>
<p>zTree unique identifier: <b class="highlight_red">treeId</b>, easy for users to control.</p>
<p>zTree unique identifier: <b class="highlight_red">treeId</b>.</p>
<h4 class="topLine"><b>treeNode</b><span>JSON</span></h4>
<p>JSON data object of the node which be double-clicked.</p>
<h4 class="topLine"><b>Return </b><span>Boolean</span></h4>
......
......@@ -16,7 +16,7 @@
<h3>Function Parameter Descriptions</h3>
<div class="desc">
<h4><b>treeId</b><span>String</span></h4>
<p>zTree unique identifier: <b class="highlight_red">treeId</b>, easy for users to control.</p>
<p>zTree unique identifier: <b class="highlight_red">treeId</b>.</p>
<h4 class="topLine"><b>treeNode</b><span>JSON</span></h4>
<p>JSON data object of the node which use the personalized text style</p>
<h4 class="topLine"><b>Return </b><span>JSON</span></h4>
......
......@@ -13,7 +13,7 @@
<h3>Function Parameter Descriptions</h3>
<div class="desc">
<h4><b>treeId</b><span>String</span></h4>
<p>zTree unique identifier: <b class="highlight_red">treeId</b>, easy for users to control.</p>
<p>zTree unique identifier: <b class="highlight_red">treeId</b>.</p>
<h4><b>treeNode</b><span>JSON</span></h4>
<p>JSON data object of the node which need to hide the custom control.</p>
</div>
......
......@@ -17,7 +17,7 @@
<h3>Function Parameter Descriptions</h3>
<div class="desc">
<h4><b>treeId</b><span>String</span></h4>
<p>zTree unique identifier: <b class="highlight_red">treeId</b>, easy for users to control.</p>
<p>zTree unique identifier: <b class="highlight_red">treeId</b>.</p>
<h4 class="topLine"><b>treeNode</b><span>JSON</span></h4>
<p>JSON data object of the node which need to show icon.</p>
<h4 class="topLine"><b>Return </b><span>Boolean</span></h4>
......
......@@ -19,7 +19,7 @@
<h3>Function Parameter Descriptions</h3>
<div class="desc">
<h4><b>treeId</b><span>String</span></h4>
<p>zTree unique identifier: <b class="highlight_red">treeId</b>, easy for users to control.</p>
<p>zTree unique identifier: <b class="highlight_red">treeId</b>.</p>
<h4 class="topLine"><b>treeNode</b><span>JSON</span></h4>
<p>JSON data object of the node which need to show title.</p>
<h4 class="topLine"><b>Return </b><span>Boolean</span></h4>
......
......@@ -13,11 +13,11 @@
<h3>Function Parameter Descriptions</h3>
<div class="desc">
<h4><b>targetNode</b><span>JSON</span></h4>
<p>JSON data object of the node which will be target.</p>
<p>JSON data object of the node to be target.</p>
<p class="highlight_red">If copy the node to root node, please set the 'targetNode' to null.</p>
<p class="highlight_red">Please ensure that this data object is an internal node data object in zTree.</p>
<h4 class="topLine"><b>treeNode</b><span>JSON</span></h4>
<p>JSON data object of the node which will be copied.</p>
<p>JSON data object of the node to be copied.</p>
<p class="highlight_red">Please ensure that this data object is an internal node data object in zTree.</p>
<h4 class="topLine"><b>moveType</b><span>String</span></h4>
<p>Copied to the target node's relative position.</p>
......
......@@ -14,7 +14,7 @@
<h3>Function Parameter Descriptions</h3>
<div class="desc">
<h4><b>treeNode</b><span>JSON</span></h4>
<p>JSON data object of the node which will be editing name</p>
<p>JSON data object of the node to be editing name</p>
<p class="highlight_red">Please ensure that this data object is an internal node data object in zTree.</p>
<h4 class="topLine"><b>Retrun </b><span>none</span></h4>
<p>no return value</p>
......
......@@ -13,7 +13,7 @@
<h3>Function Parameter Descriptions</h3>
<div class="desc">
<h4><b>treeNode</b><span>JSON</span></h4>
<p>JSON data object of the node which will be expanded or collapsed</p>
<p>JSON data object of the node to be expanded or collapsed</p>
<p class="highlight_red">Please ensure that this data object is an internal node data object in zTree.</p>
<h4 class="topLine"><b>expandFlag</b><span>Boolean</span></h4>
<p>expandFlag = true means: expand the node.</p>
......
......@@ -14,7 +14,7 @@
<h3>Function Parameter Descriptions</h3>
<div class="desc">
<h4><b>treeNode</b><span>JSON</span></h4>
<p>JSON data object of the node which will be hidden</p>
<p>JSON data object of the node to be hidden</p>
<p class="highlight_red">Please ensure that this data object is an internal node data object in zTree.</p>
<h4 class="topLine"><b>Retrun </b><span>none</span></h4>
<p>no return value</p>
......
......@@ -12,11 +12,11 @@
<h3>Function Parameter Descriptions</h3>
<div class="desc">
<h4><b>targetNode</b><span>JSON</span></h4>
<p>JSON data object of the node which will be target.</p>
<p>JSON data object of the node to be target.</p>
<p class="highlight_red">If move the node to root node, please set the 'targetNode' to null.</p>
<p class="highlight_red">Please ensure that this data object is an internal node data object in zTree.</p>
<h4 class="topLine"><b>treeNode</b><span>JSON</span></h4>
<p>JSON data object of the node which will be moved.</p>
<p>JSON data object of the node to be moved.</p>
<p class="highlight_red">Please ensure that this data object is an internal node data object in zTree.</p>
<h4 class="topLine"><b>moveType</b><span>String</span></h4>
<p>Moved to the target node's relative position.</p>
......
......@@ -13,7 +13,7 @@
<h3>Function Parameter Descriptions</h3>
<div class="desc">
<h4><b>treeNode</b><span>JSON</span></h4>
<p>JSON data object of the node which will be removed.</p>
<p>JSON data object of the node to be removed.</p>
<p class="highlight_red">Please ensure that this data object is an internal node data object in zTree.</p>
<h4 class="topLine"><b>callbackFlag</b><span>Boolean</span></h4>
<p>callbackFlag = true means: call this method, will trigger 'beforeRemove' & 'onRemove' callback.</p>
......
......@@ -13,7 +13,7 @@
<h3>Function Parameter Descriptions</h3>
<div class="desc">
<h4><b>treeNode</b><span>JSON</span></h4>
<p>JSON data object of the node which will be selected.</p>
<p>JSON data object of the node to be selected.</p>
<p class="highlight_red">Please ensure that this data object is an internal node data object in zTree.</p>
<h4 class="topLine"><b>addFlag</b><span>Boolean</span></h4>
<p>addFlag = true means: append to select node, don't affect the previously selected node, can select multiple nodes.</p>
......
......@@ -33,7 +33,7 @@
<p>no return value</p>
</div>
<h3>Examples of function</h3>
<h4>1. Set the selected nodes's checkbox / radio to be disabled.</h4>
<h4>1. Set the selected nodes's checkbox / radio to disable.</h4>
<pre xmlns=""><code>var treeObj = $.fn.zTree.getZTreeObj("tree");
var nodes = treeObj.getSelectedNodes();
for (var i=0, l=nodes.length; i < l; i++) {
......
......@@ -14,7 +14,7 @@
<h3>Function Parameter Descriptions</h3>
<div class="desc">
<h4><b>treeNodes</b><span>Array(JSON)</span></h4>
<p>JSON data object of the node which will be shown</p>
<p>JSON data object of the node to be shown</p>
<p class="highlight_red">Please ensure that this data object is an internal node data object in zTree.</p>
<h4 class="topLine"><b>Retrun </b><span>none</span></h4>
<p>no return value</p>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册