TreePanel and child

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1

    TreePanel and child

    hi,
    i've a database with some fields (key, father, title, ecc...). i need to put them in a treepanel searching foreach parentnode child.
                [...]
                myRows = dt.Select();
    
                for (int p = 0; p < myRows.Length; p++)
                {
                    Ext.Net.TreeNode parentNode; 
                    if (myRows[p]["FATHER"].ToString() == "")
                    {
                        // Create Parent Node if field "FATHER" is null
                        parentNode = new Ext.Net.TreeNode();
                        parentNode.Text = myRows[p]["TITLE"].ToString();
                        parentNode.Icon = Ext.Net.Icon.Application;
                        parentNode.NodeID = myRows[p]["KEY"].ToString();
                        root.Nodes.Add(parentNode);
                    }
                    else
                    {
    
                        foreach (Ext.Net.TreeNode nodo in root.Nodes.) // create childnodeID
                        {
                            if (nodo.NodeID == myRows[p]["FATHER"].ToString())
                            {
                                //Ext.Net.TreeNode nodo = root.Nodes[0];
                                Ext.Net.TreeNode childNode = new Ext.Net.TreeNode();
                                childNode.Text = myRows[p]["TITLE"].ToString();
                                childNode.NodeID = myRows[p]["KEY"].ToString();
                                nodo.Nodes.Add(childNode);
    
                            }
                        }
    This code works, but i need to populate tree in each level of child, with a recursive method, or something like that.
    I hope that I was well expressed, and sorry for my bad english ^^
  2. #2
  3. #3
    Hi,

    I tried to use PageTreeLoader, but i see only root, i'm not able to see children with my code...
  4. #4
    I'm afraid I don't understand the problem. Please clarify.
  5. #5
    I want to see a trepanel with each sublevel, but with my first code i see only first and second level. Can I post some screen?
  6. #6
    I don't think a screen-shot helps in that case.

    Please provide a simple example to reproduce the problem.

Similar Threads

  1. Replies: 5
    Last Post: Jul 24, 2012, 8:53 AM
  2. [CLOSED] Append a fully loaded child in a remote TreePanel
    By RCN in forum 2.x Legacy Premium Help
    Replies: 4
    Last Post: May 30, 2012, 12:23 PM
  3. New tab from child tab
    By ven in forum 1.x Help
    Replies: 1
    Last Post: Dec 20, 2011, 2:03 AM
  4. Replies: 5
    Last Post: Mar 23, 2011, 9:57 AM
  5. Treepanel - get child values of selected parent
    By Tbaseflug in forum 1.x Help
    Replies: 2
    Last Post: Nov 10, 2009, 11:28 AM

Posting Permissions