Marc-QNX
27 Oct 2011, 7:32 AM
I took the example from the layout docs (http://docs.sencha.com/touch/2-0/#!/guide/layouts) and tried implementing it in MVC but they do not seem to work. Card layout works but the rest seem to have some issues. The following code basically behaves as if there is no layout element and each item is just displayed as a single narrow line.
Am I doing something wrong or is this broken? I have tried this with vbox, hbox, with and without align: stretch/middle. Everything is always laid out as if I have nothing in the layout attribute.
Ext.Loader.setConfig({ enabled: true });
Ext.application({
name: 'Test',
controllers: ['Main'],
});
Ext.define('Test.controller.Main', {
extend: 'Ext.app.Controller',
views : [
'Home',
],
refs: [ {
ref : 'index',
selector: 'homeView',
}],
init: function() {
this.getHomeView().create();
},
});
Ext.define('Test.view.Home', {
extend: 'Ext.Container',
config: {
fullscreen: true,
layout: 'hbox',
items: [
{
xtype: 'panel',
html: 'message list',
flex: 1
},
{
xtype: 'panel',
html: 'message preview',
flex: 2
}
]
},
});
Am I doing something wrong or is this broken? I have tried this with vbox, hbox, with and without align: stretch/middle. Everything is always laid out as if I have nothing in the layout attribute.
Ext.Loader.setConfig({ enabled: true });
Ext.application({
name: 'Test',
controllers: ['Main'],
});
Ext.define('Test.controller.Main', {
extend: 'Ext.app.Controller',
views : [
'Home',
],
refs: [ {
ref : 'index',
selector: 'homeView',
}],
init: function() {
this.getHomeView().create();
},
});
Ext.define('Test.view.Home', {
extend: 'Ext.Container',
config: {
fullscreen: true,
layout: 'hbox',
items: [
{
xtype: 'panel',
html: 'message list',
flex: 1
},
{
xtype: 'panel',
html: 'message preview',
flex: 2
}
]
},
});