I need to create multiple node levels down in WebDataTree on client side using javascript.
Here is what I need:
->Parent 1
-> Child1
-->Child 2
---> Child4
Here is the code I use:
for (var i = 0; i < 5; i++) { child_node = wdtTREE.createNode("Child1"); if (i==0) { parent_node.getItems().add(child_node); }
parent_node.Expanded = true; parent_node.Selected = true; child_node.ExpandAnscestors(); parent_node = child_node; }
When I use this code, It is creating the first node under Parent. After that in the loop when i=2, it cannot add and I'm getting this error.
0x800a138f - JavaScript runtime error: Unable to get property 'add' of undefined or null reference
Please assist.
Hello Naveen,
Thank you for using our community.
Please refer to the following treads and samples that I believe can be useful for your case:
http://es.infragistics.com/community/forums/t/51266.aspx
http://es.infragistics.com/community/forums/t/67799.aspx
Online sample:
http://es.infragistics.com/samples/aspnet/data-tree/using-client-side-api
Online documentation:
http://help.infragistics.com/Doc/ASPNET/Current/CLR4.0?page=WebDataTree~Infragistics.Web.UI_namespace.html
If you need further assistance, please let me know.
Hello Marina,
I have checked all the links that you suggested earlier. But those does not help my purpose.
Can you provide me an example for my requirement. I'm able to add nodes at the parent level. But when I convert child node to be a parent node and add one more node under it, I'm not able to do it.
Please advice.