Hi There,
I have a treeview that has around 1100 nodes, I've added a type ahead search for the treeview using onClientKeyPressingHandler on a textbox. I loop through all the nodes of the treeview returned by the get_allNodes() method and look for match by getting the node text using get_text(). This is working well in IE, but in Chrome, the get_allNodes is returning some empty nodes which hence are not being returned as matches, any suggestions/ideas on what I could be doing wrong? I'm including my javascript code i'm using to search.
Thanks,
Phani
I have a treeview that has around 1100 nodes, I've added a type ahead search for the treeview using onClientKeyPressingHandler on a textbox. I loop through all the nodes of the treeview returned by the get_allNodes() method and look for match by getting the node text using get_text(). This is working well in IE, but in Chrome, the get_allNodes is returning some empty nodes which hence are not being returned as matches, any suggestions/ideas on what I could be doing wrong? I'm including my javascript code i'm using to search.
function FindAppendages(treeview, textSearch) { var radtree = $find(treeview); var nodes = radtree.get_allNodes(); var subsetArray = new Array(); for (var i = 0; i < nodes.length; i++) { var oNode = nodes[i]; if (oNode.get_text().toLowerCase().match(textSearch.value.toLowerCase()) != null) { oNode.set_visible(true); var parent = oNode.get_parent(); if (parent != null) { parent.set_visible(true); if (parent._text != undefined) { subsetArray.push(parent.get_text());parent.set_expanded(true); } } parent = parent.get_parent(); if (parent != null) { parent.set_visible(true); if (parent._text != undefined) { subsetArray.push(parent.get_text());parent.set_expanded(true); } } parent = parent.get_parent(); if (parent != null) { parent.set_visible(true); if (parent._text != undefined) { subsetArray.push(parent.get_text());parent.set_expanded(true); } } parent = parent.get_parent(); if (parent != null) { parent.set_visible(true); if (parent._text != undefined) { subsetArray.push(parent.get_text());parent.set_expanded(true); } } } else { var match = false; for (var j = 0; j < subsetArray.length; j++) { if (oNode.get_text() == subsetArray[j]) match = true; } if (!match) oNode.set_visible(false); } }}Thanks,
Phani