Client code change form GSO-GUI to OPEN-O GUI
[vnfsdk/refrepo.git] / portal-common / src / main / webapp / common / thirdparty / zTree / api / en / setting.view.addHoverDom.html
diff --git a/portal-common/src/main/webapp/common/thirdparty/zTree/api/en/setting.view.addHoverDom.html b/portal-common/src/main/webapp/common/thirdparty/zTree/api/en/setting.view.addHoverDom.html
new file mode 100644 (file)
index 0000000..f490a20
--- /dev/null
@@ -0,0 +1,45 @@
+<div class="apiDetail">\r
+<div>\r
+       <h2><span>Function(treeId, treeNode)</span><span class="path">setting.view.</span>addHoverDom</h2>\r
+       <h3>Overview<span class="h3_info">[ depends on <span class="highlight_green">jquery.ztree.exedit</span> js ]</span></h3>\r
+       <div class="desc">\r
+               <p></p>\r
+               <div class="longdesc">\r
+                       <p>Used to display custom control when mouse move over the node. (e.g. the rename and remove button)</p>\r
+                       <p class="highlight_red">If you use this function, so must set <span class="highlight_red">setting.view.removeHoverDom</span>, please make sure that a better understanding of zTree before you use it.</p>\r
+                       <p>Default: null</p>\r
+               </div>\r
+       </div>\r
+       <h3>Function Parameter Descriptions</h3>\r
+       <div class="desc">\r
+       <h4><b>treeId</b><span>String</span></h4>\r
+       <p>zTree unique identifier: <b class="highlight_red">treeId</b>, easy for users to control.</p>\r
+       <h4 class="topLine"><b>treeNode</b><span>JSON</span></h4>\r
+       <p>JSON data object of the node which need to display the custom control.</p>\r
+       </div>\r
+       <h3>Examples of setting & function</h3>\r
+       <h4>1. Display a button when mouse move over the node, and hide the button when mouse move out.</h4>\r
+       <pre xmlns=""><code>var setting = {\r
+       view: {\r
+               addHoverDom: addHoverDom,\r
+               removeHoverDom: removeHoverDom,\r
+               ......\r
+       }\r
+};\r
+function addHoverDom(treeId, treeNode) {\r
+       var aObj = $("#" + treeNode.tId + "_a");\r
+       if ($("#diyBtn_"+treeNode.id).length>0) return;\r
+       var editStr = "&lt;span id='diyBtn_space_" +treeNode.id+ "' &gt;&nbsp;&lt;/span&gt;"\r
+               + "&lt;button type='button' class='diyBtn1' id='diyBtn_" + treeNode.id\r
+               + "' title='"+treeNode.name+"' onfocus='this.blur();'&gt;&lt;/button&gt;";\r
+       aObj.append(editStr);\r
+       var btn = $("#diyBtn_"+treeNode.id);\r
+       if (btn) btn.bind("click", function(){alert("diy Button for " + treeNode.name);});\r
+};\r
+function removeHoverDom(treeId, treeNode) {\r
+       $("#diyBtn_"+treeNode.id).unbind().remove();\r
+       $("#diyBtn_space_" +treeNode.id).unbind().remove();\r
+};\r
+......</code></pre>\r
+</div>\r
+</div>
\ No newline at end of file