Create a gist now

Instantly share code, notes, and snippets.

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{
url: '<?= RELATIVE_PATH ?>/Nav/View',
root: 'response',
fields: ['id', 'name']
//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
var viewport = new Ext.Viewport({
layout: 'border',
items: [
... your other panels, one of which must have "region: 'center'",
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment