-
18 Oct 2011 2:28 PM #1
Answered: Stuck trying to load a view
Answered: 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
home controllerCode: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/index viewCode:Ext.define('rpc.controller.home', { extend: 'Ext.app.Controller', views: ['home.index'], init: function () { console.log('rpc.controller.home ~ init'); } });
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' } });
-
Best Answer Posted by TommyMaintz
I would suggest reading the following articles:
http://www.sencha.com/learn/architec...xt-js-4-part-1
http://www.sencha.com/learn/architec...xt-js-4-part-2
http://www.sencha.com/learn/architec...xt-js-4-part-3
The only difference between ExtJS 4 and ST2 is that in ST2 you have to define the view configuration inside of the config: {} object. Other then that those articles apply directly to ST2.
-
19 Oct 2011 7:28 AM #2Sencha - Sencha Touch Dev Team
- Join Date
- Mar 2007
- Location
- Haarlem, Netherlands
- Posts
- 1,235
- Vote Rating
- 4
- Answers
- 28
I would suggest reading the following articles:
http://www.sencha.com/learn/architec...xt-js-4-part-1
http://www.sencha.com/learn/architec...xt-js-4-part-2
http://www.sencha.com/learn/architec...xt-js-4-part-3
The only difference between ExtJS 4 and ST2 is that in ST2 you have to define the view configuration inside of the config: {} object. Other then that those articles apply directly to ST2.


Reply With Quote
