zTree创建quickSearch检索框

   <!--html元素---->
<div id="plantTreeDiv" class="zTree-box treeZone">
	<div id="ztree_quick_search"> </div>
    <div style="height: 520px;overflow-y: auto;">
<ul id="plantZtree" class="ztree">
</ul>
</div>
</div>
//创建quick-search
document.getElementById("keyword").addEventListener("input", quickSearch, false);
function quickSearch(){
var treeObj = $.fn.zTree.getZTreeObj("plantZtree");
var keywords=$("#keyword").val();
var nodes = treeObj.getNodesByParamFuzzy("name", keywords, null);
if (nodes.length>0) {
treeObj.selectNode(nodes[0]);
}
}
//效果如图:

zTree创建quickSearch检索框

上一篇:Java的一些常见问题,JRE,JDK,JVM,包等概念理解


下一篇:判断android是否是debug