Hi,
how can I reload a node in my tree from javascript?
A node is expanded, no sub nodes were loaded.
Through a web service we add a node to the tree, ie the database.
If the web service call was successful, we try to reload the selected node with the code below.
It works, almost. First item we add, nothing happens. Second item the node expands.
We use version 4.3.5.74
Any help is appreciated!
function _onMethodComplete(result, eventArgs)
{
if(result)
{
var selectedNode = treeview.getSelectedNode();
if (selectedNode)
{
var expanded = selectedNode.getExpanded();
var nodes = selectedNode.getChildNodes();
selectedNode.collapse();
for ( var i in nodes )
{
nodes[i].remove();
}
selectedNode.setPopulateNodesOnDemand(true);
if(expanded)
{
selectedNode.expand();
}
}
else
{
alert("There is no selected node.");
}
}
else
{
alert("The status couldn't be saved");
}
}