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
785
Reg: Need help on Infragistics WebDataTree Node Properties & methods
posted

HI,

 Previous we used UltraWebTree for that we used below properties & functions in our project. Now we are Migrating UltrsWebTree to WebDataTree. Please let me know Alternate of below properties & Functions supporting to WebDataTree

we used for UltraWebTree properties & functions like igtree_getNodeById, node.getDataKey, igtree_getTreeById

function UltraWebTreeResourceFolders_AfterNodeSelectionChange()
    {                                                          
        var selectedNode = tree.getSelectedNode();
        var folderKey = selectedNode.getDataKey();
                  
             // Logic


            selectedNode.scrollIntoView(false);             
        }
    }

 var childkey = childNode.getDataKey();
 if(dataKey == childkey)
   {                    
         if(!childNode.getExpanded())
       {
           childNode.setExpanded(true);
         }                    
         childNode.set_Selected(true);                                            
           childNode.scrollIntoView(false);
           return;
      }

Thanks in advance

Thanks & Regards

Ram

Parents Reply
  • 10685
    Suggested Answer
    Offline posted in reply to ramya y

    Hello,
    There are several methods and properties you could use. For example
    FindNodeByKey, AllNodes, Key

    The FindNodeByKey method will return the node on the specific Nodes collection on which you’ve called the method. In order to find a specific node based on its key in the complete list of nodes in the tree you can use the AllNodes property which will return an array list with all nodes in the tree in depth-first order. You can loop in that collection and check the related Key of each node.

    AllNodes - Returns an ArrayList consisting of the complete list of nodes in the tree in depth-first order.

    For example:
    ArrayList nodesList = WebDataTree1.AllNodes;
        for(int i=0; i<nodesList.Count; i++)
        {
            if (((Infragistics.Web.UI.NavigationControls.NavItem)(nodesList[i])).Key == "ChildNode1.2")
                {
                //your code here
                } 

    DataTreeNode Class Members à

    Key - Set or gets a string value that can be used to uniquely identify a node, independent of its Text or Value properties. The Key property can be bound to a DataSource field using the NodeBinding.KeyField property setting. (Inherited from Infragistics.Web.UI.NavigationControls.NavItem)

    DataItem - Sets or gets an object value that contains a reference to the object in the data source that supplied the data for this item. (Inherited from Infragistics.Web.UI.Framework.CollectionUIObject)

    FindNodeByKey- Finds the node with the specified key if such exists, null otherwise.

Children
No Data