billtricarico
25 Feb 2012, 11:57 AM
Hello,
I can't seem to wire up a tree panel in Designer 2. Here is what I am doing:
1. Drag a TreePanel to the canvas. Looks like it has a built-in dummy tree structure.
2. Drag a TreeStore over to the Stores. Give it name, url, etc. It is my understanding that a TreeStore does not require an explicit model, nor explicit fields. But Designer still insists on either a model or fields added to the TreeStore. I copied the simple tree JSON from the TreePanel Sencha docs:
{
expanded:true,
children:[
{
id:1,
text:"detention",
leaf:true
},
{
id:2,
text:"homework",
expanded:true,
children:[
{
id:3,
text:"book report",
leaf:true
},
{
id:4,
text:"algebra",
leaf:true
}
]
},
{
id:5,
text:"buy lottery tickets",
leaf:true
}
]
}
and then tried to load the data. All I get is an error popup that shows "0:" in the box.
Can someone give me a step by step on how to create a simple Tree that loads data from a server?
Thanks.
Incidentally, I have a feature request: In Project Inspector, can you add the ability to right-click on those colored circles (Application, Controllers, Views, Stores, Models) and allow the just add an object? Instead of dragging the object from the left of the screen across the canvas to the right side and drop it just right?
I can't seem to wire up a tree panel in Designer 2. Here is what I am doing:
1. Drag a TreePanel to the canvas. Looks like it has a built-in dummy tree structure.
2. Drag a TreeStore over to the Stores. Give it name, url, etc. It is my understanding that a TreeStore does not require an explicit model, nor explicit fields. But Designer still insists on either a model or fields added to the TreeStore. I copied the simple tree JSON from the TreePanel Sencha docs:
{
expanded:true,
children:[
{
id:1,
text:"detention",
leaf:true
},
{
id:2,
text:"homework",
expanded:true,
children:[
{
id:3,
text:"book report",
leaf:true
},
{
id:4,
text:"algebra",
leaf:true
}
]
},
{
id:5,
text:"buy lottery tickets",
leaf:true
}
]
}
and then tried to load the data. All I get is an error popup that shows "0:" in the box.
Can someone give me a step by step on how to create a simple Tree that loads data from a server?
Thanks.
Incidentally, I have a feature request: In Project Inspector, can you add the ability to right-click on those colored circles (Application, Controllers, Views, Stores, Models) and allow the just add an object? Instead of dragging the object from the left of the screen across the canvas to the right side and drop it just right?