Skip to content

Commit

Permalink
Improved english descriptions
Browse files Browse the repository at this point in the history
  • Loading branch information
MikeDBR committed Apr 25, 2015
1 parent 7a2ee0b commit aafa18f
Show file tree
Hide file tree
Showing 9 changed files with 63 additions and 48 deletions.
20 changes: 11 additions & 9 deletions api/en/fn.zTree._z.html
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
<div class="apiDetail">
<div>
<h2><span>JSON</span><span class="path">$.fn.zTree.</span>_z</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>All of the methods in zTree v3.x are available through the '$. fn.zTree._z' calls, open it for you to develop your own zTree plug-ins.</p>
<p class="highlight_red">If you have no special requirements, please don't use this object, and don't modify the methods in this object.</p>
</div>
</div>
<h2><span>JSON</span><span class="path">$.fn.zTree.</span>_z</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>All of the internal methods in zTree v3.x are available through '$. fn.zTree._z',
use this if you want to develop your own zTree plug-ins.</p>
<p class="highlight_red">Unless you are writing a plugin,
you should not use this object.</p>
</div>
</div>
</div>
</div>
15 changes: 8 additions & 7 deletions api/en/fn.zTree.destroy.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,25 @@ <h3>Overview<span class="h3_info">[ depends on <span class="highlight_green">jqu
<div class="desc">
<p></p>
<div class="longdesc">
<p>From zTree v3.4, zTree support the method for destruction.</p>
<p>1. This method can destroy the zTree with specify treeId, and can destroy all of the zTrees.</p>
<p class="highlight_red">2. If you want to destory some one zTree, you can use the 'zTreeObj.destroy()' method.</p>
<p class="highlight_red">3. If you want to use the tree which has been destroyed, you must use the 'init()' method at first.</p>
<p>From zTree v3.4, zTree provides a method for destruction.</p>
<p>1. This method can destroy a zTree by treeId, or destroy all zTree instances.</p>
<p class="highlight_red">2. If you want to destroy a zTree, you can use the 'zTreeObj.destroy()' method.</p>
<p class="highlight_red">3. If you want to re-use the tree which has been destroyed,
you must first re-initialise it with the 'init()' method.</p>
</div>
</div>
<h3>Function Parameter Descriptions</h3>
<div class="desc">
<h4><b>treeId</b><span>String</span></h4>
<p>zTree unique identifier</p>
<p class="highlight_red">If this parameter is omitted, then will destroy all of the zTrees.</p>
<p class="highlight_red">If this parameter is omitted, all zTree instances will be destroyed.</p>
<h4 class="topLine"><b>Return </b><span>none</span></h4>
<p>no return value</p>
</div>
<h3>Examples of function</h3>
<h4>1. destroy the zTree which its id is 'treeDemo'</h4>
<h4>1. Destroy the zTree with id === 'treeDemo'</h4>
<pre xmlns=""><code>$.fn.zTree.destroy("treeDemo");</code></pre>
<h4>2. destroy all of the zTrees</h4>
<h4>2. Destroy all zTree instances</h4>
<pre xmlns=""><code>$.fn.zTree.destroy();</code></pre>
</div>
</div>
10 changes: 6 additions & 4 deletions api/en/fn.zTree.getZTreeObj.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@ <h3>Overview<span class="h3_info">[ depends on <span class="highlight_green">jqu
<div class="desc">
<p></p>
<div class="longdesc">
<p>zTree v3.x specifically provide the method which can use the tree's Id to get zTree object.</p>
<p>zTree v3.x provides this method to get zTree object from the tree's Id.</p>
<p class="highlight_red">Please initialize zTree first, then you can use this method.</p>
<p>Users don't need to set the global variable to hold the zTree object, and all of the callback will return 'treeId' parameters, the user can always use this method to get the zTree object.</p>
<p>Users don't need to use a global variable to reference the zTree object,
as all of the callback methods will pass 'treeId' parameters,
and you can always call this method to get the zTree object.</p>
</div>
</div>
<h3>Function Parameter Descriptions</h3>
Expand All @@ -16,10 +18,10 @@ <h4><b>treeId</b><span>String</span></h4>
<p>zTree unique identifier</p>
<h4 class="topLine"><b>Return </b><span>JSON</span></h4>
<p>zTree object</p>
<p>This object can provide the methods of operate the zTree</p>
<p>This is a reference to the zTree object.</p>
</div>
<h3>Examples of function</h3>
<h4>1. Get the zTree object which id is 'tree'</h4>
<h4>1. Get the zTree object with id='tree'</h4>
<pre xmlns=""><code>var treeObj = $.fn.zTree.getZTreeObj("tree");</code></pre>
</div>
</div>
26 changes: 16 additions & 10 deletions api/en/fn.zTree.init.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,18 @@ <h3>Overview<span class="h3_info">[ depends on <span class="highlight_green">jqu
<div class="desc">
<p></p>
<div class="longdesc">
<p>The method which used to create zTree.</p>
<p>1. The web page need to use W3C markup. For example: &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"&nbsp;&nbsp; &nbsp;"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;</p>
<p>2. Need to load jquery-1.4.2.js or other higher versions.</p>
<p>3. Need to load jquery-ztree.core-3.0.js. If you need to use the edit mode or checkbox / radio mode, you need to load jquery-ztree.exedit-3.0.js and jquery-ztree.excheck-3.0.js.</p>
<p>4. Need to load zTreeStyle.css and image files</p>
<p>5. If you need to use custom icons, please refer to the appropriate Demo.</p>
<p>6. Note: You need to set zTree container's class name to "ztree". If you need to change, don't forget to modify the css file. If you need other special styles, can modify the css file to their own needs.</p>
<p>This method is used to create a zTree.</p>
<p>1. The web page must use the W3C DTD. For example: &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"&nbsp;&nbsp; &nbsp;"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;</p>
<p>2. Needs jquery-1.4.2.js or better.</p>
<p>3. Needs jquery-ztree.core-3.0.js or better.
If you are using edit mode or checkbox / radio mode,
make sure you load jquery-ztree.exedit-3.0.js and jquery-ztree.excheck-3.0.js.</p>
<p>4. Needs zTreeStyle.css and image files</p>
<p>5. If you plan to use custom icons, please refer to the Demo,
or see the help on iconSkin.</p>
<p>6. Note: You need to set zTree container's class name to "ztree".
If you need to change it, don't forget to modify the css file.
If you need other special styles, you can modify the css file.</p>
</div>
</div>
<h3>Function Parameter Descriptions</h3>
Expand All @@ -22,9 +27,10 @@ <h4 class="topLine"><b>zSetting</b><span>JSON</span></h4>
<p>zTree's configuration data, please refer to "setting details" in the API Document.</p>
<h4 class="topLine"><b>zNodes</b><span>Array(JSON) / JSON</span></h4>
<p>zTree's node data, please refer to "treeNode data details" in the API Document.</p>
<p class="highlight_red">1. zTree v3.x support to add single node, that is, if only to add one node, you can use JSON without using Array.</p>
<p class="highlight_red">2. If you need asynchronous load root nodes, can be set to null or [ ]</p>
<p class="highlight_red">3. If you use simple data mode, please refer to "setting.data.simpleData" in the API Document.</p>
<p class="highlight_red">1. zTree v3.x support to add single node, that is, if only to add one node,
you can use JSON without using Array.</p>
<p class="highlight_red">2. If you are planning on using asynchronous loading of root nodes, set it to null or [ ]</p>
<p class="highlight_red">3. If you are using simple data mode, please refer to "setting.data.simpleData" in the API Document.</p>
<h4 class="topLine"><b>Return </b><span>JSON</span></h4>
<p>zTree object</p>
<p>This object can provide the methods of operate the zTree</p>
Expand Down
15 changes: 9 additions & 6 deletions api/en/setting.async.autoParam.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,17 @@ <h3>Overview<span class="h3_info">[ depends on <span class="highlight_green">jqu
<div class="desc">
<p></p>
<div class="longdesc">
<p>Required automatically submit the parameters about the properties of the parent node, when the asynchronous load. It is valid when <span class="highlight_red">[setting.async.enable = true]</span></p>
<p>During asynchronous loading, a request is sent to the server, which contains the identify of the parent node,
so it can retrieve the children.
This attribute is an array of strings, which is the identity parameter (or parameters).
It applies 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>1. Just save the attribute name of node to the array. For example: ["id", "name"]</p>
<p>2. You can change the parameter name. For example: server only accepts "zId" -- ["id=zId"]</p>
<p>1. Put the attribute name(s) of node to the array. For example: ["id", "name"]</p>
<p>2. You can rename the parameter name as sent to the server. For example: server only accepts "zId" -- ["id=zId"]</p>
</div>
<h3>Examples of setting</h3>
<h4>1. set auto commit 'id' attribute</h4>
Expand All @@ -23,17 +26,17 @@ <h4>1. set auto commit 'id' attribute</h4>
autoParam: ["id"]
}
};
If have the parent node: {id:1, name:"test"}, When asynchronously load this parent node's child nodes, will be submitted parameters: id=1
If we have a parent node: {id:1, name:"test"}, When we are asynchronously loading this parent node's children, it will be submitted to the server with parameters: id=1
......</code></pre>
<h4>2. set auto commit 'id' attribute, but parameter name is 'zId'</h4>
<h4>2. set auto commit 'id' attribute, but the parameter name expected by the server is 'zId'</h4>
<pre xmlns=""><code>var setting = {
async: {
enable: true,
url: "http://host/getNode.php",
autoParam: ["id=zId"]
}
};
If have the parent node: {id:1, name:"test"}, When asynchronously load this parent node's child nodes, will be submitted parameters: zId=1
If we have a parent node: {id:1, name:"test"}, When we are asynchronously loading this parent node's children, it will be submitted to the server with parameters: zId=1
......</code></pre>
</div>
</div>
3 changes: 2 additions & 1 deletion api/en/setting.async.contentType.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ <h3>Overview<span class="h3_info">[ depends on <span class="highlight_green">jqu
<div class="desc">
<p></p>
<div class="longdesc">
<p>When Ajax sending data to the server, use this content-type. It is valid when <span class="highlight_red">[setting.async.enable = true]</span></p>
<p>When Ajax sends data to the server, it uses this content-type.
It is used when <span class="highlight_red">[setting.async.enable = true]</span></p>
<p>Default:"application/x-www-form-urlencoded"</p>
</div>
</div>
Expand Down
10 changes: 5 additions & 5 deletions api/en/setting.async.dataFilter.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,26 @@ <h3>Overview<span class="h3_info">[ depends on <span class="highlight_green">jqu
<div class="desc">
<p></p>
<div class="longdesc">
<p>Function used to pre-process for the return data of Ajax. It is valid when <span class="highlight_red">[setting.async.enable = true]</span></p>
<p>Callback function to pre-process Ajax return data. It is valid when <span class="highlight_red">[setting.async.enable = true]</span></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>parentNode</b><span>JSON</span></h4>
<p>Parent node's JSON data object</p>
<p class="highlight_red">When asynchronously loading the root, the parentNode = null</p>
<h4 class="topLine"><b>responseData</b><span>Array(JSON) / JSON / String</span></h4>
<p>Ajax got Array (JSON) / JSON / String data objects</p>
<p class="highlight_red">From v3.4, support the string with XML format.</p>
<p>Array (JSON) / JSON / String data objects</p>
<p class="highlight_red">From v3.4, support XML strings.</p>
<h4 class="topLine"><b>Return </b><span>Array(JSON) / JSON</span></h4>
<p>The return value should be the JSON data structure which is supported by the zTree.</p>
<p class="highlight_red">v3.x supports to load single node JSON data object.</p>
</div>
<h3>Examples of setting & function</h3>
<h4>1. Modify the node name attribute which is ajax got.</h4>
<h4>1. Modify the node name attributes returned by an Ajax request.</h4>
<pre xmlns=""><code>function ajaxDataFilter(treeId, parentNode, responseData) {
if (responseData) {
for(var i =0; i < responseData.length; i++) {
Expand Down
6 changes: 3 additions & 3 deletions api/en/setting.async.dataType.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ <h3>Overview<span class="h3_info">[ depends on <span class="highlight_green">jqu
</div>
<h3>String Format</h3>
<div class="desc">
<p> dataType = "text", It can meet most of the needs.</p>
<p class="highlight_red">The 'dataType' in zTree and jQuery's ajax is same.</p>
<p> dataType = "text", There is probably no need to change this.</p>
<p class="highlight_red">The 'dataType' in zTree and jQuery's ajax requests is same.</p>
</div>
<h3>Examples of setting</h3>
<h4>1. Set the dataType which ajax got is text.</h4>
<h4>1. Set the dataType which ajax retrieves to "text".</h4>
<pre xmlns=""><code>var setting = {
async: {
enable: true,
Expand Down
6 changes: 3 additions & 3 deletions api/en/setting.async.enable.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@ <h3>Overview<span class="h3_info">[ depends on <span class="highlight_green">jqu
<div class="desc">
<p></p>
<div class="longdesc">
<p>Set zTree asynchronous loading mode is turned on or off.</p>
<p>Set zTree asynchronous loading mode on/off.</p>
<p>Default: false</p>
</div>
</div>
<h3>Boolean Format</h3>
<div class="desc">
<p> true - turn on asynchronous loading mode</p>
<p> false - turn off asynchronous loading mode</p>
<p class="highlight_red">If set it is true, you must set attributes in setting.async</p>
<p class="highlight_red">If you don't pass 'treeNodes' parameter when initialize zTree, the root nodes will get by ajax.</p>
<p class="highlight_red">If set it is true, you must set other attributes in setting.async</p>
<p class="highlight_red">If you don't pass the 'treeNodes' parameter when you initialize zTree, the root nodes will be retrieved using ajax.</p>
</div>
<h3>Examples of setting</h3>
<h4>1. Turn on asynchronous loading mode</h4>
Expand Down

0 comments on commit aafa18f

Please sign in to comment.