View Full Version : Carousel dynamically adding cards problem - all about rendering?

Eric Clapton
22 Jul 2011, 12:45 AM
I'm trying to implement Sencha Touch Carousel component to my app.
I take photos and show those photos in a carousel.

For instance;I take 2 photos and when app gets back from Camera it shows only the first photo not the second one in carousel.When I try to scroll to next card I see an empty card.

Finally I think my problem is all about rendering.I put doLayout and doComponentLayout everywhere in my code to check if it works but no use.

Any help will be appreciated.Thanks.

for (i = 0, len = mediaFiles.length; i < len; i += 1) {
this.cardItems.push(new Ext.Container({
scroll: 'horizontal',
styleHtmlContent: true,
html: "<center><img src='" + mediaFiles[i].fullPath + "' style='display:block;max- width:90%;min-width:90%;max-height:90%;min-height:90%;'/></center>"

22 Jul 2011, 1:08 AM
without really looking into to you eg i'm not 100% sure why this doesn't work but you should be able to just call

this.carousel.removeAll(true);// force the destroy
//bla the carditems

to do this.