Edit in JSFiddle

{
onLaunch: function() {
    
        Ext.DomHelper.append(Ext.getBody(), {tag: 'input', type:'hidden', id: Ext.History.fieldId});
        Ext.DomHelper.append(Ext.getBody(), {tag: 'iframe', style:'display: none;', id: Ext.History.iframeId});
        
        Ext.History.init(function() {

            Ext.History.on('change', function(menuItemId) {
                
                this.fireEvent('menu-item-selected', menuItemId);
            
            }, this);

        }, this);
    
}
}