View Full Version : loading TreePanel with json data

5 Aug 2013, 10:33 PM
I have defined a TreePanel:
var nordicSeaTree = new Ext.tree.TreePanel({
width: 200,
autoScroll: true,
split: true,
loader: new Ext.tree.TreeLoader(),
root: new Ext.tree.AsyncTreeNode({
text: "fish",
expanded: true,
children: "${species.name}"
rootVisible: true,
where spescies.name="[{text:\'First Level Child 1\',leaf: true}]"
Instead of getting root: "fish" and one child element "First Level Child1" I get many children under "fish" one for each character in species.name. like so: "fish" -> "[", "{", "t","e","x","t"... and so on

Any idea what im doing wrong? Im trying to populate the treePanel with json objects from the server. Pretty basic. But cant get it working...

7 Aug 2013, 10:03 PM
Your json is invalid:


"text": "FirstLevelChild1",
"leaf": true