PDA

View Full Version : add items after orientationchange on a fullscreen panel



gorekee
27 Oct 2010, 4:22 AM
Hi,

I have the following problem.

I will add new elements in a carousel, but I remove the old and add new ones.
Unfortunately, this does not work, it will not appear.

When I add new without the old remove these precede.



mainPanel = new Ext.Carousel({
fullscreen: true,
indicator: false,
id: 'main',
defaults: {
flex: 1
},
listeners: {
afterrender: function () {

if (helper.detectLandscape())
this.add(sitemap, about_us, sitemapOverview.landscape);
else
this.add(sitemap, about_us, sitemapOverview.landscape);

this.doLayout();


},
orientationchange: function () {

var currentPage = this.getActiveIndex();

this.removeAll();
if (helper.detectLandscape())
this.add(sitemap, about_us, sitemapOverview.landscape);
else
this.add(sitemap, about_us, sitemapOverview.landscape);

this.doLayout();

}
},
animation: 'slide',
dockedItems: [{
xtype: 'toolbar',
dock: 'bottom',
id: 'bottom_toolbar',
items: [{
xtype: 'spacer'
},
{
html: 'About us',
ui: 'round',
cls: 'Btn_articles',
handler: function () {
mainPanel.setCard(1);
}

}
}]
}]
}),


Thanks for your help.

gorekee
28 Oct 2010, 5:02 AM
can anybody help, at the moment i am totally lost :-?

gorekee
29 Oct 2010, 5:58 AM
For people who have the same problem.

I now do not delete all items but only at a certain point all of the following. If I delete all items and add new sencha touch get me a black screen.



var removeItems = this.items.items.slice(),
ln = removeItems.length,
i;

for (i = 0; i < ln; i++) {
if( i > 3 )
this.remove(removeItems[i]);
}


greetings
daniel