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
Hello,
In case of migration, I recommend you to review the API documentation for the newer WebDataTree to learn more about the control:http://help.infragistics.com/doc/ASPNET?page=Web_WebDataTree.htmlThis will ensure you will get to know the new control faster. I believe once familiar with the existing API, it will be easier to achieve a similar functionality.
igtree_getTreeById - You could find the WebDataTree at the client using the AJAX $find method.You could use one of the following approaches, in order to access the WebDataTree with specific ID’s at the client side:var tree = $find("<%=this. WebDataTree1.ClientID%>");
And in case you have ensured the use of static id for the WebDataTree when initialized on the server (like WebDataTree1.ClientIDMode = System.Web.UI.ClientIDMode.Static;), you could use the following client side syntax as well: var tree = $find("WebDataTree1")In general, by defining 'ClientIDMode' as static you are saying that your 'ClinetID' and 'ServerID' will have the same values.
igtree_getNodeById – No exact equivalent is existing. You could use the node address to achieve similar functionality. Details hereAdditionally it is possible to navigate to a specific node like using getNode function.$find("WebDataTree1").getNode(1)
node.getDataKey - You could use DataItem or the Key property of WebDataTree nodes.
Since it is not possible to connect each existing property to a new equivalent, I suggest you to look at the shared resources. During the migration you may also want to search through the forum for similar issues as many others have already faced similar issues.
You may also benefit from the following resources:
WebDataTree Official Doc SectionWebDataTreeDocumentationWebDataTree ClientSide LibraryWebDataTree NamespaceNode class MembersOnline SamplesWebDataTree FAQ
Thanks for given reply.
node.getDataKey - Using This property we getting that particular node folder key in existing, but as you said instead of this use dataitem, i tried to use but am not getting exactly which property need to use, please let me know how to get perticular node folderkey.
$find("WebDataTree1").getNode(1) - here hard coded node key as '1', please letme know how can i get 'getnode()' values depends on folder selection dynamically
Thanks
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.