I tried to get this to work for quite some time, but so far I have not been able to find a solution for this other than adding after viewing inside the listeners in the view. But I want the controller to handle it.
Does anyone have an idea on how I can solve this?
This is what I have in my files at the moment http://pastie.org/2751446
controller/App.js Ext.define('HD.controller.App', { extend: 'Ext.app.Controller' ,views: [ 'core.Header', 'core.Navigation', 'core.Content' ] ,init: function() { this.control({ 'navigation a[id=tab1]': { click: this.newTab } }) } ,newTab: function() { console.log('Tab 1 should be loaded now'); } });
View / core /Navigation.js
Ext.define('HD.view.core.Navigation', { extend: 'Ext.panel.Panel' ,name: 'navigation' ,alias: 'widget.navigation' ,layout: 'accordion' ,region: 'west' ,width: 200 ,title: 'Navigation' ,collapsible: true ,items: [ { title: 'Title 1' ,html: '<a id="tab1" style="cursor:pointer;">Tab 1</a>' }, { title: 'Title 2' ,html: 'Second' } ] });
source share