Reputation: 4396
I'm starting to play around with sencha touch 2 and ran into the following problem. I'm trying to build a very simple application which has a listview and a tabpanel with a button :
I'm seeing the tabpanel with my button and nice title; but the listview refuses to show; i've tried adding 'layout: fit' but it's even worse.
What 'obvious' thing am I missing here ?
Main.js:
Ext.define('CurrencyFX.view.Main', {
extend: 'Ext.Panel',
requires: [
'CurrencyFX.view.Home',
'CurrencyFX.view.CurrencyList',
],
config: {
items: [
{ xtype: 'homecard' },
{ xtype: 'currencycard' },
]
}
});
Home.js:
Ext.define('CurrencyFX.view.Home', {
extend: 'Ext.Panel',
requires: ['Ext.TitleBar'],
xtype: 'homecard',
config: {
items: [{
docked: 'top',
xtype: 'titlebar',
title: 'Currency FX',
items: [
{
text: 'Refresh',
align: 'right',
action: 'reloadQuotes'
}
]
}
]
}
});
CurrencyList.js:
Ext.define('CurrencyFX.view.CurrencyList', {
extend: 'Ext.List',
requires: ['CurrencyFX.store.Currencies'],
xtype: 'currencycard',
config: {
itemTpl: '{name} is at {value}',
store: 'Currencies',
}
})
Upvotes: 1
Views: 951
Reputation:
Can you add a height to the currencycard? This provides a quick check:
items: [ { xtype: 'homecard'}, { xtype: 'currencycard', height: 500 } ]
Here's a layout that will fill the screen (note that I moved docked: 'top' to here!!):
Ext.define('CurrencyFX.view.Main', { extend: 'Ext.Panel', requires: [ 'CurrencyFX.view.Home', 'CurrencyFX.view.CurrencyList' ], config: { fullscreen: true, layout: 'fit', items: [ { xtype: 'homecard', docked: 'top' }, { xtype: 'currencycard'} ] } });
Upvotes: 2