var tree=$find("ctl00_ContentPlaceHolder1_UserPrivilege2_tvUsers");
var txt= document.getElementById("ctl00_ContentPlaceHolder1_UserPrivilege1_txtSearchUserName2");
1. var i;
var j=0;
var sourceNodes = tree.get_allNodes();
for(i=0;i<sourceNodes.length;i++)
{
var node = sourceNodes[i];
if(node.get_text().toLowerCase() == txt.value.toLowerCase())
{
node.select();
j++;
}
}
if(j==0)
alert("找不到对应的数据!");
tree.trackChanges();
tree.commitChanges();
2. var node = tree.findNodeByText(txt.value);
if (node !=null)
node.select();
else
alert("找不到对应的数据!");
tree.trackChanges();
tree.commitChanges();