I've got this code from a book:
Ext.define('Myapp.sample.store.mainMenu', {
extend: 'Ext.data.TreeStore',
root: {
text: 'My app',
expanded: true,
children: [{
text: 'Modules',
expanded: true,
children: [
{leaf: true, text: 'Employees'},
{leaf: true, text: 'Customers'},
{leaf: true, text: 'Products'}
]
},{
text: 'Market',
expanded: true,
children: [
{leaf: true, text: 'Sales'},
{leaf: true, text: 'Budgets'},
{leaf: true, text: 'SEO'},
{leaf: true, text: 'Statistics'}
]
},{
text: 'Support',
children: [
{leaf: true, text: 'Submit a ticket'},
{leaf: true, text: 'Forum'},
{leaf: true, text: 'Visit our web site'}
]
},
{leaf: true, text: 'Reports'},
{leaf: true, text: 'Charts'}
]
}
});
var myMenuStore = Ext.create('Myapp.sample.store.mainMenu',{});
var myPanel = Ext.create('Ext.panel.Panel',{
title:'My first breadcrumb bar...',
width:600,
height:200,
margin:50,
dockedItems:[{ //Step 2
xtype : 'breadcrumb',
dock: 'top',
store: myMenuStore,
showIcons: true,
selection: myMenuStore.getRoot().childNodes[0].childNodes[0]
}],
renderTo:Ext.getBody()
});
But I can't make it works... What's wrong with it?