Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hi there,
Does anyone know can I get all the nodes under the root node?
Cheers
mkariti
C# ofcourse
Will it be ok to use:
umbraco.presentation.nodeFactory.Node node = new umbraco.presentation.nodeFactory.Node(1122); var all = node.AllDescendants();
This is a obsolete class.
cheers
Ok So I decided to use the recursive option and added Jquery to it.
Here is my code:
private void LoadData() { Node rootNode = new Node(1122); StringBuilder sb = new StringBuilder(); sb.Append("<ul id='example'>"); DoIt(rootNode, sb); sb.Append("</ul>"); Panel1.Controls.Add(new LiteralControl(sb.ToString())); }
private void DoIt(Node node, StringBuilder sb) { foreach (Node ChildNode in node.Children) { string strChecked = ""; sb.Append("<li>"); if (CategoryManager.HasRelation(this.CurrentMemebrID, ChildNode.Id)) strChecked = "checked='checked'"; else strChecked = ""; sb.Append("<input type='checkbox' value='" + ChildNode.Id + "'" + strChecked + " name='CategoryTree' id='" + ChildNode.Id + "'>"); sb.Append(ChildNode.Name); if (ChildNode.Children.Count > 0) { sb.Append("<ul>"); DoIt(ChildNode, sb); sb.Append("</ul>"); } sb.Append("</li>"); } }
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.
Continue discussion
Get all nodes under root
Hi there,
Does anyone know can I get all the nodes under the root node?
Cheers
mkariti
C# ofcourse
Hi there,
Will it be ok to use:
This is a obsolete class.
cheers
mkariti
Ok So I decided to use the recursive option and added Jquery to it.
Here is my code:
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.