PDA

View Full Version : TreeStore - root node with data



Igor.Szyporyn
3 Mar 2014, 3:34 AM
Hello.

This is using ExtJs 4.0.7

I have an object with children in it - this object I wish to set as the root node of my treepanel, which works just fine.

However this root node has no data!

My object looks like this

{
"stacktoken": 1,
"leaf": false,
"iconCls": "no-icon",
...,
"children": [
{
"stacktoken": 2,
"leaf": true,
"iconCls": "no-icon",
...
},
{
"stacktoken": 3,
"leaf": true,
"iconCls": "no-icon",
...
}
]
}

This is the response I get from the service I call, and this works just fine - it shows me the two children in the treepanel but not the rootnode.

Problem is root node has NO DATA!

I have tried to have the root node be a empty shell, and then setting the node with stacktoken 1 as the new root node - which kind of works - but it does not render the children when I do this, and the treepanel is empty.

Also have tried to copy the node and then setting that as the new root node - but in 4.0.7 the node copy method is broken.

Hope someone can help me out here.

a.premkumar
3 Mar 2014, 4:58 AM
Hi Igor,

Have you tried setting the rootVisible : true of the tree view?

Regards,
Premkumar. A

Igor.Szyporyn
3 Mar 2014, 6:30 AM
That is exactly the problem - it can NOT be true.I have:Root-- ChildNode---- ChildNode---- ChildNodeNow I want the first level ChildNode to act as if it was the root without being visible - which will let me render the children just like a flat grid, but still be able to maintain the nested object.