var node = eventArgs.get_node()
var checked = node.get_checked()
var nodes = node.get_nodes()
for (var i = 0; i < nodes.get_count(); i++) {
nodes.getNode(i).set_checked(checked)
if (nodes.getNode(i).get_nodes().get_count > 0) {
UpdateAllChildren_Prometheus(nodes.getNode(i).get_nodes())
}
}
What I tried is adding an OnClientNodeChecking event to populate the node when it is checked by doing:
var node = eventArgs.get_node()
if (node.get_level() == 0 && node.get_nodes().get_count() == 0) {
node.expand()
}
This populates the node, but the new children are not checked after both events are fired. It seems this may be a race condition, but am not sure. If I then uncheck and check the parent node, this works fine as the child nodes are already present. How can I make sure the node is populated before the OnClientNodeChecked event is fired? Keep in mind that the user is not going to expand the node before checking it. Hopefully I'm missing something easy.
Thanks.