PDA

View Full Version : Cannot get listview and another view in vbox layout to work



fhdeveloper
19 Jul 2010, 12:55 PM
Hi,
I've been banging my head trying to get this to work:
I have a panel. I set the layout of the panel to 'vbox'. I add a sub panel with some info, then the list. It doesn't work its just blank. Anyone know what is going on?

evant
19 Jul 2010, 10:17 PM
Ext.setup({
tabletStartupScreen: 'tablet_startup.png',
phoneStartupScreen: 'phone_startup.png',
icon: 'icon.png',
glossOnIcon: false,
onReady: function(){
Ext.regModel('Contact', {
fields: ['firstName', 'lastName']
});

new Ext.Container({
fullscreen: true,
layout: {
type: 'vbox',
align: 'stretch'
},
items: [{
flex: 1,
html: 'Top'
}, new Ext.List({
flex: 2,
tpl: '<tpl for="."><div class="contact"><strong>{firstName}</strong> {lastName}</div></tpl>',
itemSelector: 'div.contact',

singleSelect: true,
grouped: true,
indexBar: true,

store: new Ext.data.Store({
model: 'Contact',
sorters: 'firstName',

getGroupString: function(record){
return record.get('firstName')[0];
},

data: [{
firstName: 'Tommy',
lastName: 'Maintz'
}, {
firstName: 'Ed',
lastName: 'Spencer'
}, {
firstName: 'Jamie',
lastName: 'Avins'
}, {
firstName: 'Aaron',
lastName: 'Conran'
}, {
firstName: 'Dave',
lastName: 'Kaneda'
}]
})
})]
});
}
});