Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
115
is there a way to force tree to allow only one node set to be open at once
posted

Hi,

is there a way to force tree to allow only one node set to be open at once?

thanks

regards,

onan.

Parents
No Data
Reply
  • 28407
    posted

    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 (nodesIdea.Id != nodeId)
           nodesIdea.setExpanded(false);
         }
     }
     
     
    // node.setExpanded(true);
     

     

     

Children