Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7835829
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T13:49:31+00:00 2026-06-02T13:49:31+00:00

In a tree structure like this var rootNode = { id: ‘root’, text :

  • 0

In a tree structure like this

var rootNode = { 
              id: 'root',
              text : 'Root Node',
    expanded : true,
    children : [
    {
        id :  'c1',
        text : 'Child 1',
        leaf : true
    },
    {
        id :  'c2',
        text : 'Child 2',
        leaf : true
    },
    {
        id :  'c3',
        text : 'Child 3',
        children : [
        {
            id :  'gc1',
            text : 'Grand Child',
            children : [
            {
                id :  'gc11',
                text : 'Grand Child 1',
                leaf : true
            },
            {
                id :  'gc12',
                text : 'Grand Child 2',
                leaf : true
            }
            ]
        }
        ]
    }
    ]
};

var tree = new Ext.tree.TreePanel({
    id: 'treePanel',
    autoscroll: true,
    root: rootNode
});

How do I add a child node of any node (say ‘grandchild’)?

I can access the child by traversing the root of the treepanel, but I console.logged it in Firebug, it does not have any functions.
Sorry for the unformatted code, I was not able to format it.

Tree Panel

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T13:49:33+00:00Added an answer on June 2, 2026 at 1:49 pm

    Do something like this:

    var treeNode = tree.getRootNode();
    treeNode.expandChildren(true); // Optional: To see what happens
    treeNode.appendChild({
            id: 'c4',
            text: 'Child 4',
            leaf: true
    });
    treeNode.getChildAt(2).getChildAt(0).appendChild({
            id: 'gc13',
            text: 'Grand Child 3',
            leaf: true
    });
    

    If this is what you need, check out NodeInterface Class. It has many useful methods:
    http://docs.sencha.com/ext-js/4-0/#!/api/Ext.data.NodeInterface

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a simple tree structure represented like this: Node { int Id; int
I need to create MySQL tables that represent a tree structure like this: Root
I have a tree like structure roughly like this: class Node < ActiveRecord::Base belongs_to
My Tree structure looks like this, containing three classes Index,Key,Value Index1 | -- Key1
In C# I have an intrusive tree structure that looks like this: public abstract
I've got a tree-like structure. Each element in this structure should be able to
We have tree structure like this: <Tree> <child1> <child2> <child2> </child1> </Tree> Here the
I'm using a huge binary tree like structure whose nodes may or may not
I'm looking to build a tree-like structure for my Java application. I've tried using
I need to be able to make a tree like structure in the appengine

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.