I am trying to use the restful example to load data into a tree store. I'm partially successful, but when you click on any parent item that has children, all that happens is that instead of expanding and showing the children it indents inward.
Before click:
Screen Shot 2019-11-20 at 4.28.21 PM.png
One click:
Screen Shot 2019-11-20 at 4.29.14 PM.png
Another click:
Screen Shot 2019-11-20 at 4.29.56 PM.png
The numbers in parenthesis are how many children there should be inside.
Example json output from my php script:
Code:
{"success":true,
"message":"Loaded courses",
"data":[
{
"id":"11060",
"section":"0100",
"meeting":"M W 14:00:00 15:15:00 IV THEA1",
"course":"ANTH 0002 (22)",
"children":[
{"id":"11061","course":"ANTH 0002","meeting":" W 08:00:00 08:50:00 HSSB 1237","leaf":true},
{"id":"11062","course":"ANTH 0002","meeting":"M 17:00:00 17:50:00 HSSB 4201","leaf":true},
...
{"id":"11082","course":"ANTH 0002","meeting":" R 17:00:00 17:50:00 HSSB 4202","leaf":true}
]
},
{
"id":"11083",
"section":"0100",
"meeting":" T R 17:00:00 18:15:00 BRDA 1610",
"course":"ANTH 0007 (9)",
"children":[
{"id":"11085","course":"ANTH 0007","meeting":"M 16:00:00 16:50:00 GIRV 2116","leaf":true},
...
{"id":"11089","course":"ANTH 0007","meeting":" W 18:00:00 18:50:00 LSB 1101","leaf":true}
]
}
ect....
]}
I'm loading the data on the fly when you click on an item corresponding to the department in a list that displays in another region of a view.
The selectionchange event is loading the data:
Code:
selecteditems = selmodel.getSelected().items[0].data;
var coursesStore = Ext.getCmp('CoursesGrid').getStore();// pass in the id of the thing
coursesStore.setProxy({
type: 'rest',
url: WWROOT+'/lib/app.php/courses',
extraParams: {
quarter: localStorage.getItem("Quarter"),
department: selecteditems.id
},
reader: {
type: 'json',
rootProperty: 'data',
successProperty: 'success'
}
});
coursesStore.load();
I've probably done this all wrong, but I can't figure out how else to do it.