zalyahya
zalyahya

Reputation: 153

Sencha Architect: Build a tree

How can I build a tree ins Sencha Architect? All what I found online was concerned with editing the code which is read-only in my case. What can I do about that?

Please help! I would really appreciate it because I've been having a hard time figuring it out.

Thank you in advance

Upvotes: 2

Views: 1661

Answers (1)

A1rPun
A1rPun

Reputation: 16847

  1. Add a TreeStore with the config specified below*
  2. Add a TreePanel with {store: 'TreeStore', rootVisible: false}

*

fields: [{
    name: 'text'
}],
//please note that you need to wrap the root config inside an object {}
root: {
    expanded: true,
    children: [
            { text: "detention", leaf: true },
            { text: "homework", expanded: true, children: [
                { text: "book report", leaf: true },
                { text: "algebra", leaf: true}
            ] },
            { text: "buy lottery tickets", leaf: true }
    ]
}

Edit1:
Press this GREEN icon to edit the root config.
Edit mode

Upvotes: 2

Related Questions