Jquery EasyUI Combotree展開全部父節點node
Jquery EasyUI Combotree獲取樹完整路徑spa
Jquery EasyUI tree展開全部父節點對象
Jquery EasyUI tree獲取完整路徑blog
================================get
©Copyright 蕃薯耀 2018年5月11日string
https://www.cnblogs.com/fanshuyao/it
- function expandParent(treeObj, node){
- var parentNode = treeObj.tree("getParent", node.target);
- if(parentNode != null && parentNode != "undefined"){
- treeObj.tree("expand", parentNode.target);
- expandParent(treeObj, parentNode);
- }
- };
-
- function treeInitValueAndExpand(treeObj, leafValue){
- var nodesChecked = treeObj.tree("getChecked");
- if(nodesChecked.length > 0){
- for(var i=0; i<nodesChecked.length; i++){
- expandParent(treeObj, nodesChecked[i]);
- }
- }
- };
-
- function getTreePathNames(treeObj, node){
- var pathName = node.text;
- var parentNode = treeObj.tree("getParent", node.target);
- if(parentNode != null && parentNode != "undefined"){
- pathName = getTreePathNames(treeObj, parentNode) + " > " + pathName;
- }
- return pathName;
- };
-
- function getCombotreePathNames(combotreeId, leafValue){
- var combotreeObj = $("#"+combotreeId);
- var treeObj = combotreeObj.combotree("tree");
- var nodesChecked = treeObj.tree("getChecked");
- var pathName = "";
- if(nodesChecked.length > 0){
- for(var i=0; i<nodesChecked.length; i++){
- pathName += getTreePathNames(treeObj, nodesChecked[i]);
- }
- }
- return pathName;
- };
-
-
-
- function combotreeInitValueAndExpand(combotreeId, leafValue){
- var combotreeObj = $("#"+combotreeId);
- var treeObj = combotreeObj.combotree("tree");
- combotreeObj.combotree("setValue", leafValue);
- treeInitValueAndExpand(treeObj, leafValue);
- };
================================io
©Copyright 蕃薯耀 2018年5月11日function
https://www.cnblogs.com/fanshuyao/class