public
Last active

  • Download Gist
for KWhat_Work
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
Ext.onReady(function() {
//The panel we'll be adding our nav items to
var navGroup = new Ext.Panel({
region: 'west',
width: 180
});
//assuming this returns some JSON like {response: [{title: 'My Nav Item', html: 'some text'}, {title: 'Another item', html: 'test'}]}
var store = new Ext.data.JsonStore({
url: '<?= RELATIVE_PATH ?>/Nav/View',
root: 'response',
fields: ['id', 'name']
});
store.load({
//this gets called as soon as the store has finished loading
callback: function(records) {
//create a panel for each record, add each to navGroup
Ext.each(records, function(record) {
navGroup.add(new Ext.Panel(record));
}, this);
//force navGroup to make sure its child panels are rendered properly
navGroup.doLayout();
}
});
var viewport = new Ext.Viewport({
layout: 'border',
items: [
... your other panels, one of which must have "region: 'center'",
navGroup
]
});
 
});

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.