Hi,
is there a way to force tree to allow only one node set to be open at once?
thanks regards,
onan.
HI,
Wire up the client-side NodeExpanded event.
Here is javascript code that will allow only one nodeset to be expanded at a time.
function UltraWebTree1_NodeExpand(treeId, nodeId){ //Add code to handle your event here. // debugger; var node = igtree_getNodeById(nodeId); var tree = igtree_getTreeById(treeId); var level = node.getLevel(); if (level == 0) { var nodes = tree.getNodes(); for (var i = 0; i < nodes.length; i++) { if (nodes.Id != nodeId) nodes.setExpanded(false); } } // node.setExpanded(true);
Thanks for your reply much appreciated.
I tried your code and it throws an 'object doesnt support this property or method' error on the lines:-
if (nodes.Id != nodeId) nodes.setExpanded(false);
any suggestions please?
thanks again
regards,onan.
HI onan,
What version of NetAdvantage are you using. This javascript function was tested with 7.3.1043. It works
function UltraWebTree1_NodeExpand(treeId, nodeId){ //Add code to handle your event here. //Add code to handle your event here. // debugger; var node = igtree_getNodeById(nodeId); var tree = igtree_getTreeById(treeId); var level = node.getLevel(); if (level == 0) { var nodes = tree.getNodes(); for (var i = 0; i < nodes.length; i++) { if (nodes.Id != nodeId) nodes.setExpanded(false); } // node.setExpanded(true);
}}
The WebTree has property called SingleBranchExpand, try setting that to true.
here is a help link to this property
http://help.infragistics.com/Help/NetAdvantage/NET/2008.1/CLR2.0/html/Infragistics2.WebUI.UltraWebNavigator.v8.1~Infragistics.WebUI.UltraWebNavigator.UltraWebTree~SingleBranchExpand.html