PDA

View Full Version : List Items don't wrap correctly



NitrOuS
25 Nov 2010, 3:45 AM
I have a list shown in my application. the following code is its configuration:



var list = new Ext.List({
fullscreen: true,
singleSelect: true,
itemTpl : '<strong>{Name}</strong><br/><small>{Address}</small>',
layout: Ext.is.Phone? 'fit': undefined,
grouped : true,
indexBar: true,
});


Using this configuration a strange thing happens. When I first enter this screen the list items don't wrap correctly. When I change the orientation on my iPhone to landscape and then back to portrait the wrap is done with the right way. Am I doing something wrong? Thanks in advance for your time

Bucs
25 Nov 2010, 5:26 AM
Are you loading this dynamically after the page has been rendered previously? If so, you probably need to call a doLayout on your container object.

NitrOuS
25 Nov 2010, 7:10 AM
here is a part of my Ext.setup:



Ext.setup({
onReady: function ()
{

var mainTabPanel = new Ext.TabPanel({
items: [{
iconCls: 'home',
title: 'Cinemas',
items: [list]
}],
fullscreen: true,
tabBar: {
cardSwitchAnimation: 'cube',
ui: 'dark',
dock: 'bottom',
layout: {
pack: 'center'
}
}
});
}
});


Before that in my js file I do the following:


var list = new Ext.List({
fullscreen: true,
singleSelect: true,
itemTpl : '<strong>{Name}</strong><br/><p><small>{Address}</small></p>',
layout: Ext.is.Phone? 'fit': undefined,
grouped : true,
indexBar: true
});


I don't use any container. Any ideas? Thanks for answering!