Stuck trying to load a view
I'm trying my hand at ST2 and I'm stuck on the most basic of bits. I'm simply trying to load a View and I'm not sure how.
index.js
Code:
Ext.application({ name: 'rpc',
defaultUrl: 'home/index',
controllers: ['home'], //note: define controllers here
launch: function () {
console.log('Ext.application ~ launch'),
Ext.create('Ext.TabPanel', {
id: 'rpc-rootPanel',
fullscreen: true,
tabBarPosition: 'bottom',
items: [{
title: 'Home',
iconCls: 'home'
}]
});
}
});
home controller
Code:
Ext.define('rpc.controller.home', { extend: 'Ext.app.Controller',
views: ['home.index'],
init: function () {
console.log('rpc.controller.home ~ init');
}
});
home/index view
Code:
Ext.define('rpc.view.home.index', { extend: 'Ext.Panel',
id: 'rpc-view-home-index',
title: 'Home',
layout: {
type: 'vbox',
align: 'stretch'
},
defaults: { style: 'margin-bottom: 5px' },
config: {
fullscreen: true,
items: [{
xtype: 'button',
text: 'Videos',
handler: function () {
Ext.redirect('video.index');
}
}],
html:'test'
}
});