I have a TreeView that has ExpandMode set to WebService and I would like to expand a node programmatically. I have even tried to emulate this is some client side code and I can see the web service call being made and returning data. However, the node does not expand as desired.
No matter what happens, the following line always shows the number of items in the list as 0.
What am I doing wrong?
Thanks.
Is there something I can try to make this work client side?
String.prototype.endsWith = function(str){return (this.match(str+"$")==str)} |
function nodeChecked(sender, eventArgs) { |
var node = eventArgs.get_node(); |
var parent = node.get_parent(); |
var grand_parent = parent.get_parent(); |
var parent_value = parent.get_value(); |
var parent_value_other = ""; |
if (parent_value.endsWith("cc")) { |
parent_value_other = parent_value.substring(0, parent_value.length - 2) |
var tree = $find("<%= RadTreeView1.ClientID %>"); |
var other_node = tree.findNodeByValue(parent_value_other); |
if (other_node.get_expanded() == false) { |
other_node.expand(); |
} |
var other_node_array = other_node.get_nodes(); |
for (var i = 0; i < other_node_array.get_count(); i++) { |
var _node = other_node_array.getNode(i); |
if (_node.get_text() == node.get_text()) { |
_node.check(); |
break; |
} |
} |
} |
} |
No matter what happens, the following line always shows the number of items in the list as 0.
var other_node_array = other_node.get_nodes(); |
What am I doing wrong?
Thanks.
Is there something I can try to make this work client side?