PDA

View Full Version : Automatically expand node - Ext JS TreeStore



ank5
18 Oct 2013, 5:17 AM
I am using Ext Js TreeStore node to create a Tree. Is it possible to automatically expand a specific node in the rendered tree?

The tree is rendered using the json file (example below). Is there something that I can put in this json file which would tell ext js that the specific node(s) need to be expanded by default, when the tree is rendered.


[{
"text":"app22",
"children":[
{
"text":"app123.js",
"leaf":"true",
"iconCls":"js"
},{
"text":"controller",
"children":[]
},{
"text":"model",
"children":[]
},{
"text":"store",
"children":[
{
"text":"Files.js",
"leaf":"true",
"iconCls":"js"
}
]
},{
"text":"view",
"children":[
{
"text":"BasicTreePanel.js",
"leaf":"true",
"iconCls":"js"
},
{
"text":"TreeStorePanel.js",
"leaf":"true",
"iconCls":"js"
}
]
}
]
}]


thank you

scottmartin
21 Oct 2013, 1:34 PM
You should be able to add:
"expanded" : true,

Scott.