EXT tree 连续定位树节点
一:根据树代码定位树某个节点
调用处
/** * 模糊定位树节点 * @param node * @param name * @param index * @return */var findindex = 0;function focusTreeNodeByFuzzy(node,name,index,focusFlag){var arr = new Array();var c = -1;while(node){c++;var temp=node;var showName = '';if (focusFlag == 'code')showName = node.id;else if (focusFlag =='name')showName = node.text;if(showName.indexOf(name)<0 || c<=index){if (!node.lastChild){if (node.nextSibling)node = node.nextSibling;else if (!node.nextSibling && node.parentNode)node = node.parentNode.nextSibling;elsenode = node.nextSibling;}else{node = node.firstChild;} if(!node){node=temp;while(node.parentNode && node.parentNode.parentNode && !node.nextSibling){node=node.parentNode;}node=node.nextSibling;}}else{arr.push(node);arr.push(c);return arr;}}return null;};