怎么才能只查询最后一级
ztree吧
全部回复
仅看楼主
level 1
function searchNode(e) {
if('up'==e){
searchIndex--;
}
if('down'==e){
searchIndex++;
}
// 取得输入的关键字的值
var value = $.trim(key.get(0).value);
// 按名字查询
var keyType = "name";
if (key.hasClass("empty")) {
value = "";
}
// 如果要查空字串,就退出不查了。
if (value === "") {
return;
}
updateNodes(false);
nodeList = tree.getNodesByParamFuzzy(keyType, value);
updateNodes(true);
}
function updateNodes(highlight) {
if(searchIndex<0){
searchIndex=nodeList.length-1;
}
if(searchIndex>=nodeList.length){
searchIndex=0;
}
for(var i=0, l=nodeList.length; i<l; i++) {
//alert(nodeList.length);
nodeList[i].highlight = highlight;
tree.updateNode(nodeList[i]);
tree.expandNode(nodeList[i].getParentNode(), true, false, false);
if(i==searchIndex){
try{tree.checkNode(nodeList[i], true, true);}catch(e){}
tree.selectNode(nodeList[i], true);
tree.selectNode(nodeList[i], false);
}
}
}
2015年01月14日 06点01分 1
level 1
现在每一级含有关键字的都会重点显示,怎么只在最后一级重点显示
2015年01月14日 06点01分 2
level 11
自己写算法,处理数据吧
2015年01月17日 01点01分 3
level 2
同问啊
2015年01月18日 13点01分 4
1